summaryrefslogtreecommitdiff
path: root/eit.c
diff options
context:
space:
mode:
Diffstat (limited to 'eit.c')
-rw-r--r--eit.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/eit.c b/eit.c
index 2bab1a5..9b2442c 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.72 2003/04/21 13:21:54 kls Exp $
+ * $Id: eit.c 1.74 2003/04/27 14:41:36 kls Exp $
***************************************************************************/
#include "eit.h"
@@ -1232,7 +1232,7 @@ void cSIProcessor::Action()
int r = safe_read(filters[a].handle, buf, sizeof(buf));
if (r > 3) // minimum number of bytes necessary to get section length
{
- int seclen = ((buf[1] & 0x0F) << 8) | (buf[2] & 0xFF) + 3;
+ int seclen = (((buf[1] & 0x0F) << 8) | (buf[2] & 0xFF)) + 3;
int pid = filters[a].pid;
if (seclen == r)
{
@@ -1444,18 +1444,21 @@ int cSIProcessor::GetCaDescriptors(int Source, int Transponder, int ServiceId, c
if (BufSize > 0 && Data) {
cMutexLock MutexLock(&caDescriptorsMutex);
int length = 0;
- do {
- for (cCaDescriptor *d = caDescriptors.First(); d; d = caDescriptors.Next(d)) {
- if (d->source == Source && d->transponder == Transponder && d->serviceId == ServiceId && d->caSystem == *CaSystemIds) {
- if (length + d->Length() <= BufSize) {
- memcpy(Data + length, d->Data(), d->Length());
- length += d->Length();
+ for (cCaDescriptor *d = caDescriptors.First(); d; d = caDescriptors.Next(d)) {
+ if (d->source == Source && d->transponder == Transponder && d->serviceId == ServiceId) {
+ const unsigned short *caids = CaSystemIds;
+ do {
+ if (d->caSystem == *caids) {
+ if (length + d->Length() <= BufSize) {
+ memcpy(Data + length, d->Data(), d->Length());
+ length += d->Length();
+ }
+ else
+ return -1;
}
- else
- return -1;
- }
+ } while (*++caids);
}
- } while (*++CaSystemIds);
+ }
return length;
}
return -1;