summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-01-09 14:27:36 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2017-01-09 14:27:36 +0100
commit196f2af596509a318d4f5a83009167ea2bdcf61f (patch)
tree7783e0f23eacfb2601ba73100cf955f235e45ac6 /device.c
parentd1ddb3978185ce8b3a7f783fac74b82a352fd650 (diff)
downloadvdr-196f2af596509a318d4f5a83009167ea2bdcf61f.tar.gz
vdr-196f2af596509a318d4f5a83009167ea2bdcf61f.tar.bz2
The mechanism of trying different CAMs when switching to an encrypted channel is now only triggered if there acually is more than one CAM in the system
Diffstat (limited to 'device.c')
-rw-r--r--device.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/device.c b/device.c
index 19997e45..9bb00b42 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 4.4 2017/01/09 12:51:05 kls Exp $
+ * $Id: device.c 4.5 2017/01/09 14:25:38 kls Exp $
*/
#include "device.h"
@@ -1678,12 +1678,14 @@ bool cDevice::AttachReceiver(cReceiver *Receiver)
Unlock();
if (camSlot && Receiver->priority > MINPRIORITY) { // priority check to avoid an infinite loop with the CAM slot's caPidReceiver
camSlot->StartDecrypting();
- startScrambleDetection = time(NULL);
- scramblingTimeout = TS_SCRAMBLING_TIMEOUT;
- bool KnownToDecrypt = ChannelCamRelations.CamDecrypt(Receiver->ChannelID(), camSlot->SlotNumber());
- if (KnownToDecrypt)
- scramblingTimeout *= 10; // give it time to receive ECM/EMM
- dsyslog("CAM %d: %sknown to decrypt channel %s (scramblingTimeout = %ds)", camSlot->SlotNumber(), KnownToDecrypt ? "" : "not ", *Receiver->ChannelID().ToString(), scramblingTimeout);
+ if (CamSlots.Count() > 1) { // don't try different CAMs if there is only one
+ startScrambleDetection = time(NULL);
+ scramblingTimeout = TS_SCRAMBLING_TIMEOUT;
+ bool KnownToDecrypt = ChannelCamRelations.CamDecrypt(Receiver->ChannelID(), camSlot->SlotNumber());
+ if (KnownToDecrypt)
+ scramblingTimeout *= 10; // give it time to receive ECM/EMM
+ dsyslog("CAM %d: %sknown to decrypt channel %s (scramblingTimeout = %ds)", camSlot->SlotNumber(), KnownToDecrypt ? "" : "not ", *Receiver->ChannelID().ToString(), scramblingTimeout);
+ }
}
Start();
return true;