From 196f2af596509a318d4f5a83009167ea2bdcf61f Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 9 Jan 2017 14:27:36 +0100 Subject: [PATCH] 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 --- HISTORY | 3 ++- device.c | 16 +++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/HISTORY b/HISTORY index ae1f54bb..22523c2e 100644 --- a/HISTORY +++ b/HISTORY @@ -8894,4 +8894,5 @@ Video Disk Recorder Revision History by Dietmar Spingler). This speeds up switching to encrypted channels after newly starting VDR, in case there is more than one CAM in the system. - Fixed a flaw in handling timeouts for encrypted channels. - +- 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. 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;