diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2017-05-01 09:32:32 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2017-05-01 09:32:32 +0200 |
commit | 073268bd45a4a36e0d20ba1a60d585e9cae13e30 (patch) | |
tree | 65f8eba2ba526aeac251d1d1756abfac18cfee3d /device.c | |
parent | 7cfce2fffa067a702af4e3b18e52e7d631dc006c (diff) | |
download | vdr-073268bd45a4a36e0d20ba1a60d585e9cae13e30.tar.gz vdr-073268bd45a4a36e0d20ba1a60d585e9cae13e30.tar.bz2 |
CAMs are now sent a generated EIT packet that contains a single 'present event' for the current SID, in order to avoid any parental rating dialogs
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 4.15 2017/04/17 14:47:42 kls Exp $ + * $Id: device.c 4.16 2017/05/01 09:24:49 kls Exp $ */ #include "device.h" @@ -1652,6 +1652,7 @@ bool cDevice::Receiving(bool Dummy) const #define TS_SCRAMBLING_TIMEOUT 3 // seconds to wait until a TS becomes unscrambled #define TS_SCRAMBLING_TIME_OK 10 // seconds before a Channel/CAM combination is marked as known to decrypt +#define EIT_INJECTION_TIME 10 // seconds for which to inject EIT event void cDevice::Action(void) { @@ -1697,6 +1698,18 @@ void cDevice::Action(void) } } } + // Inject EIT event to avoid the CAMs parental rating prompt: + if (Receiver->startEitInjection) { + time_t Now = time(NULL); + if (cCamSlot *cs = CamSlot()) { + if (Now != Receiver->lastEitInjection) { // once per second + cs->InjectEit(Receiver->ChannelID().Sid()); + Receiver->lastEitInjection = Now; + } + } + if (Now - Receiver->startEitInjection > EIT_INJECTION_TIME) + Receiver->startEitInjection = 0; + } } } Unlock(); @@ -1755,6 +1768,10 @@ 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(); + if (camSlot->WantsTsData()) { + Receiver->lastEitInjection = 0; + Receiver->startEitInjection = time(NULL); + } if (CamSlots.NumReadyMasterSlots() > 1) { // don't try different CAMs if there is only one Receiver->startScrambleDetection = time(NULL); Receiver->scramblingTimeout = TS_SCRAMBLING_TIMEOUT; |