From 8976ebcec5ca1ac03c54209b7cc12e9d14915c6b Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 4 Jan 2004 12:30:00 +0100 Subject: Implemented automatic PID switching and channel detection --- ci.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'ci.c') 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 #include @@ -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); -- cgit v1.2.3