[ANNOUNCE] VDR developer version 1.5.0

Message ID 45A8CCAB.8020606@cadsoft.de
State New
Headers

Commit Message

Klaus Schmidinger Jan. 13, 2007, 12:12 p.m. UTC
  Petri Helin wrote:
> ...
> BTW: I have been patching the device.c in 1.4.* series so that my other
> card, TT budget DVB-C v1.0, is always preferred for FTA channel
> recordings. Otherwise the precious CAM could be wasted in an FTA
> recording. I understood that you are planning on restructuring the
> priority model in 1.5.*. Have you taken in consideration the situation
> with budget-only environment with one or more CIs?

Please try the attached patch and let me know if it works
as expected.

Klaus
  

Patch

===================================================================
RCS file: RCS/device.c
retrieving revision 1.138
diff -u -r1.138 device.c
--- device.c	2007/01/07 13:41:07	1.138
+++ device.c	2007/01/13 12:05:00
@@ -334,6 +334,7 @@ 
              imp <<= 8; imp |= min(max((NumUsableSlots ? SlotPriority[j] : 0) + MAXPRIORITY, 0), 0xFF);              // use the CAM slot with the lowest priority (+MAXPRIORITY to assure that values -99..99 can be used)
              imp <<= 1; imp |= ndr;                                                                                  // avoid devices if we need to detach existing receivers
              imp <<= 1; imp |= device[i]->IsPrimaryDevice();                                                         // avoid the primary device
+             imp <<= 1; imp |= NumUsableSlots ? 0 : device[i]->HasCi();                                              // avoid cards with Common Interface for FTA channels
              imp <<= 1; imp |= device[i]->HasDecoder();                                                              // avoid full featured cards
              imp <<= 1; imp |= NumUsableSlots ? !ChannelCamRelations.CamDecrypt(Channel->GetChannelID(), j + 1) : 0; // prefer CAMs that are known to decrypt this channel
              if (imp < Impact) {
@@ -367,6 +368,11 @@ 
   return d;
 }
 
+bool cDevice::HasCi(void)
+{
+  return false;
+}
+
 void cDevice::SetCamSlot(cCamSlot *CamSlot)
 {
   camSlot = CamSlot;
===================================================================
RCS file: RCS/device.h
retrieving revision 1.80
diff -u -r1.80 device.h
--- device.h	2007/01/03 14:14:29	1.80
+++ device.h	2007/01/13 11:33:57
@@ -314,6 +314,8 @@ 
   time_t startScrambleDetection;
   cCamSlot *camSlot;
 public:
+  virtual bool HasCi(void);
+         ///< Returns true if this device has a Common Interface.
   void SetCamSlot(cCamSlot *CamSlot);
          ///< Sets the given CamSlot to be used with this device.
   cCamSlot *CamSlot(void) const { return camSlot; }
===================================================================
RCS file: RCS/dvbdevice.c
retrieving revision 1.161
diff -u -r1.161 dvbdevice.c
--- dvbdevice.c	2007/01/05 11:09:51	1.161
+++ dvbdevice.c	2007/01/13 11:37:00
@@ -509,6 +509,11 @@ 
   return spuDecoder;
 }
 
+bool cDvbDevice::HasCi(void)
+{
+  return ciAdapter;
+}
+
 uchar *cDvbDevice::GrabImage(int &Size, bool Jpeg, int Quality, int SizeX, int SizeY)
 {
   if (devVideoIndex < 0)
===================================================================
RCS file: RCS/dvbdevice.h
retrieving revision 1.42
diff -u -r1.42 dvbdevice.h
--- dvbdevice.h	2007/01/05 10:39:52	1.42
+++ dvbdevice.h	2007/01/13 11:35:07
@@ -84,6 +84,11 @@ 
 protected:
   virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
 
+// Common Interface facilities:
+
+public:
+  virtual bool HasCi(void);
+
 // Image Grab facilities
 
 private: