summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-11-26 13:39:47 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-11-26 13:39:47 +0100
commit3a97be4fe96792f19674630edac762ae5a060b90 (patch)
treef76dfe9c1b3e5fbd3c9a6369e4b3974a2d353f00 /device.c
parent2fecf43be9fc7e0372589d1cce408ed5f5e2e210 (diff)
downloadvdr-3a97be4fe96792f19674630edac762ae5a060b90.tar.gz
vdr-3a97be4fe96792f19674630edac762ae5a060b90.tar.bz2
Implemented handling of the "CA PMT Reply" for CAMs; some preparations for being able to record several encrypted channels from the same transponder
Diffstat (limited to 'device.c')
-rw-r--r--device.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/device.c b/device.c
index 0da5a492..1b4cec45 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 1.111 2005/11/05 15:23:58 kls Exp $
+ * $Id: device.c 1.112 2005/11/26 12:56:09 kls Exp $
*/
#include "device.h"
@@ -397,6 +397,8 @@ bool cDevice::AddPid(int Pid, ePidType PidType)
DelPid(Pid, PidType);
return false;
}
+ if (ciHandler)
+ ciHandler->SetPid(Pid, true);
}
PRINTPIDS("a");
return true;
@@ -424,6 +426,8 @@ bool cDevice::AddPid(int Pid, ePidType PidType)
DelPid(Pid, PidType);
return false;
}
+ if (ciHandler)
+ ciHandler->SetPid(Pid, true);
}
}
return true;
@@ -450,6 +454,8 @@ void cDevice::DelPid(int Pid, ePidType PidType)
if (pidHandles[n].used == 0) {
pidHandles[n].handle = -1;
pidHandles[n].pid = 0;
+ if (ciHandler)
+ ciHandler->SetPid(Pid, false);
}
}
PRINTPIDS("E");
@@ -601,12 +607,34 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
sectionHandler->SetStatus(false);
sectionHandler->SetChannel(NULL);
}
+ // Tell the ciHandler about the channel switch and add all PIDs of this
+ // channel to it, for possible later decryption:
+ if (ciHandler) {
+ ciHandler->SetSource(Channel->Source(), Channel->Transponder());
+// Men at work - please stand clear! ;-)
+#ifdef XXX_DO_MULTIPLE_CA_CHANNELS
+ if (Channel->Ca() > CACONFBASE) {
+#endif
+ ciHandler->AddPid(Channel->Sid(), Channel->Vpid(), 2);
+ for (const int *Apid = Channel->Apids(); *Apid; Apid++)
+ ciHandler->AddPid(Channel->Sid(), *Apid, 4);
+ for (const int *Dpid = Channel->Dpids(); *Dpid; Dpid++)
+ ciHandler->AddPid(Channel->Sid(), *Dpid, 0);
+#ifdef XXX_DO_MULTIPLE_CA_CHANNELS
+ bool CanDecrypt = ciHandler->CanDecrypt(Channel->Sid());//XXX
+ dsyslog("CanDecrypt %d %d %d %s", CardIndex() + 1, CanDecrypt, Channel->Number(), Channel->Name());//XXX
+ }
+#endif
+ }
if (SetChannelDevice(Channel, LiveView)) {
// Start section handling:
if (sectionHandler) {
sectionHandler->SetChannel(Channel);
sectionHandler->SetStatus(true);
}
+ // Start decrypting any PIDs the might have been set in SetChannelDevice():
+ if (ciHandler)
+ ciHandler->StartDecrypting();
}
else
Result = scrFailed;
@@ -1168,6 +1196,8 @@ bool cDevice::AttachReceiver(cReceiver *Receiver)
Unlock();
if (!Running())
Start();
+ if (ciHandler)
+ ciHandler->StartDecrypting();
return true;
}
}
@@ -1194,6 +1224,8 @@ void cDevice::Detach(cReceiver *Receiver)
else if (receiver[i])
receiversLeft = true;
}
+ if (ciHandler)
+ ciHandler->StartDecrypting();
if (!receiversLeft)
Cancel(3);
}