summaryrefslogtreecommitdiff
path: root/ci.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-01-04 12:30:00 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-01-04 12:30:00 +0100
commit8976ebcec5ca1ac03c54209b7cc12e9d14915c6b (patch)
tree8562202f489ee585c1252b2cb4a9e61b3e200efe /ci.c
parent3a1058fe1fca6d10cea42786aa54abf3d0bd0b94 (diff)
downloadvdr-8976ebcec5ca1ac03c54209b7cc12e9d14915c6b.tar.gz
vdr-8976ebcec5ca1ac03c54209b7cc12e9d14915c6b.tar.bz2
Implemented automatic PID switching and channel detection
Diffstat (limited to 'ci.c')
-rw-r--r--ci.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/ci.c b/ci.c
index a6f60562..760052de 100644
--- a/ci.c
+++ b/ci.c
@@ -4,13 +4,9 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: ci.c 1.20 2003/12/24 10:23:24 kls Exp $
+ * $Id: ci.c 1.21 2004/01/02 15:07:36 kls Exp $
*/
-/* XXX TODO
-- update CA descriptors in case they change
-XXX*/
-
#include "ci.h"
#include <asm/unaligned.h>
#include <ctype.h>
@@ -1570,6 +1566,23 @@ const unsigned short *cCiHandler::GetCaSystemIds(int Slot)
return cas ? cas->GetCaSystemIds() : NULL;
}
+bool cCiHandler::ProvidesCa(const unsigned short *CaSystemIds)
+{
+ cMutexLock MutexLock(&mutex);
+ for (int Slot = 0; Slot < numSlots; Slot++) {
+ cCiConditionalAccessSupport *cas = (cCiConditionalAccessSupport *)GetSessionByResourceId(RI_CONDITIONAL_ACCESS_SUPPORT, Slot);
+ if (cas) {
+ for (const unsigned short *ids = cas->GetCaSystemIds(); ids && *ids; ids++) {
+ for (const unsigned short *id = CaSystemIds; *id; id++) {
+ if (*id == *ids)
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
bool cCiHandler::SetCaPmt(cCiCaPmt &CaPmt, int Slot)
{
cMutexLock MutexLock(&mutex);