summaryrefslogtreecommitdiff
path: root/eit.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-04-18 12:48:49 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-04-18 12:48:49 +0200
commit78d85cee06c99ff4d31e8a2af929b198824b68d9 (patch)
treede67041cb2b97c2cb368eade34a7216575efdc81 /eit.c
parentb57eae00d387e24f0dc1882efeb7ecf070957cf7 (diff)
downloadvdr-78d85cee06c99ff4d31e8a2af929b198824b68d9.tar.gz
vdr-78d85cee06c99ff4d31e8a2af929b198824b68d9.tar.bz2
Now only those Ca descriptors are sent to a CAM that are actually understood by that CAM
Diffstat (limited to 'eit.c')
-rw-r--r--eit.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/eit.c b/eit.c
index de52e7c6..f4075df6 100644
--- a/eit.c
+++ b/eit.c
@@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * $Id: eit.c 1.70 2003/04/18 11:29:11 kls Exp $
+ * $Id: eit.c 1.71 2003/04/18 11:30:42 kls Exp $
***************************************************************************/
#include "eit.h"
@@ -1059,12 +1059,8 @@ public:
const cCaDescriptor *cCaDescriptors::Get(int Source, int Transponder, int ServiceId, int CaSystem)
{
for (cCaDescriptor *ca = First(); ca; ca = Next(ca)) {
- if (ca->source == Source && ca->transponder == Transponder && ca->serviceId == ServiceId) {
- if (CaSystem == -1 || ca->caSystem == CaSystem)
- return ca;
- if (CaSystem < 0)
- CaSystem++;
- }
+ if (ca->source == Source && ca->transponder == Transponder && ca->serviceId == ServiceId && ca->caSystem == CaSystem)
+ return ca;
}
return NULL;
}
@@ -1452,24 +1448,24 @@ void cSIProcessor::NewCaDescriptor(struct Descriptor *d, int ProgramID)
}
}
-int cSIProcessor::GetCaDescriptors(int Source, int Transponder, int ServiceId, int BufSize, uchar *Data)
+int cSIProcessor::GetCaDescriptors(int Source, int Transponder, int ServiceId, const unsigned short *CaSystemIds, int BufSize, uchar *Data)
{
+ if (!CaSystemIds || !*CaSystemIds)
+ return 0;
if (BufSize > 0 && Data) {
cMutexLock MutexLock(&caDescriptorsMutex);
int length = 0;
- for (int i = -1; ; i--) {
- const cCaDescriptor *d = caDescriptors->Get(Source, Transponder, ServiceId, i);
- if (d) {
- if (length + d->Length() <= BufSize) {
- memcpy(Data + length, d->Data(), d->Length());
- length += d->Length();
- }
- else
- return -1;
- }
- else
- break;
- }
+ do {
+ const cCaDescriptor *d = caDescriptors->Get(Source, Transponder, ServiceId, *CaSystemIds);
+ if (d) {
+ if (length + d->Length() <= BufSize) {
+ memcpy(Data + length, d->Data(), d->Length());
+ length += d->Length();
+ }
+ else
+ return -1;
+ }
+ } while (*++CaSystemIds);
return length;
}
return -1;