From 0b3a801ab463186519e9e1c14ea891924c64dff5 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 2 Jan 2005 15:11:44 +0100 Subject: Implemented audio track menu --- eit.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'eit.c') diff --git a/eit.c b/eit.c index 3d324561..a7d60c49 100644 --- a/eit.c +++ b/eit.c @@ -8,7 +8,7 @@ * Robert Schneider and Rolf Hakenes . * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg . * - * $Id: eit.c 1.101 2004/12/26 10:38:46 kls Exp $ + * $Id: eit.c 1.102 2005/01/02 11:52:12 kls Exp $ */ #include "eit.h" @@ -91,6 +91,8 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data) SI::ExtendedEventDescriptors *ExtendedEventDescriptors = NULL; SI::ShortEventDescriptor *ShortEventDescriptor = NULL; cLinkChannels *LinkChannels = NULL; + int NumComponents = 0; + SI::ComponentDescriptor *ComponentDescriptors[MAXCOMPONENTS]; for (SI::Loop::Iterator it2; (d = SiEitEvent.eventDescriptors.getNext(it2)); ) { switch (d->getDescriptorTag()) { case SI::ExtendedEventDescriptorTag: { @@ -186,6 +188,20 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data) } } break; + case SI::ComponentDescriptorTag: { + SI::ComponentDescriptor *cd = (SI::ComponentDescriptor *)d; + uchar Stream = cd->getStreamContent(); + uchar Type = cd->getComponentType(); + if (1 <= Stream && Stream <= 2 && Type != 0) { + if (NumComponents < MAXCOMPONENTS) { + ComponentDescriptors[NumComponents++] = cd; + d = NULL; // so that it is not deleted + } + else + dsyslog("more than %d component descriptors!", MAXCOMPONENTS); + } + } + break; default: ; } delete d; @@ -205,8 +221,20 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data) delete ExtendedEventDescriptors; delete ShortEventDescriptor; - pEvent->FixEpgBugs(); + if (NumComponents > 0) { + cComponents *Components = new cComponents(NumComponents); + for (int i = 0; i < NumComponents; i++) { + char buffer[256]; + SI::ComponentDescriptor *cd = ComponentDescriptors[i]; + Components->SetComponent(i, cd->getStreamContent(), cd->getComponentType(), I18nNormalizeLanguageCode(cd->languageCode), cd->description.getText(buffer, sizeof(buffer))); + delete cd; + } + pEvent->SetComponents(Components); + } + else + pEvent->SetComponents(NULL); + pEvent->FixEpgBugs(); if (LinkChannels) channel->SetLinkChannels(LinkChannels); if (Tid == 0x4E) { // we trust only the present/following info on the actual TS -- cgit v1.2.3