summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-05-11 11:19:37 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-05-11 11:19:37 +0200
commitafd0dd904bff4638305472b8e0ae929f1a93fe04 (patch)
tree1d7de7fadbb9b4057361dd2d509ea96716241e07
parente3e21837d06d91e3fd849af88bb2335be52c8b21 (diff)
downloadvdr-afd0dd904bff4638305472b8e0ae929f1a93fe04.tar.gz
vdr-afd0dd904bff4638305472b8e0ae929f1a93fe04.tar.bz2
Fixed handling EPG data where the 'extended event descriptor' comes before the 'short event' or a 'time shifted event'
-rw-r--r--CONTRIBUTORS4
-rw-r--r--HISTORY2
-rw-r--r--libdtv/libvdr/libvdr.c120
3 files changed, 61 insertions, 65 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index ffc71857..acee6a4e 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -639,3 +639,7 @@ Carsten Siebholz <c.siebholz@t-online.de>
Wolfgang Goeller <wgoeller@heraklit.ch>
for reporting a bug in keeping live video active in case the primary device doesn't
have an MPEG decoder
+
+Jonan Santiago <jonan-lists-vdr@callisia.com>
+ for fixing handling EPG data where the "extended event descriptor" comes before the
+ "short event" or a "time shifted event"
diff --git a/HISTORY b/HISTORY
index 94653996..18a6fd9c 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2129,3 +2129,5 @@ Video Disk Recorder Revision History
dvbplayer.c. Also, the long timeout in WaitForPut caused problems with cReceivers
that use a ring buffer and didn't immediately return from their Receive() function
if the buffer runs full (thanks to Sascha Volkenandt for reporting this one).
+- Fixed handling EPG data where the "extended event descriptor" comes before the
+ "short event" or a "time shifted event" (thanks to Jonan Santiago).
diff --git a/libdtv/libvdr/libvdr.c b/libdtv/libvdr/libvdr.c
index 0ade4d39..e041fd82 100644
--- a/libdtv/libvdr/libvdr.c
+++ b/libdtv/libvdr/libvdr.c
@@ -47,7 +47,8 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
struct LIST *Result, *EventList;
struct Event *Event;
struct Descriptor *Descriptor;
-
+ int GotVdrProgramInfo;
+
if (!siBuffer) return (NULL);
if (!(EventList = siParseEIT (siBuffer))) return (NULL);
@@ -57,9 +58,18 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
xForeach (EventList, Event)
{
VdrProgramInfo = NULL;
-
+ GotVdrProgramInfo = 0;
+
xForeach (Event->Descriptors, Descriptor)
{
+ if (!VdrProgramInfo)
+ {
+ CreateVdrProgramInfo(VdrProgramInfo,
+ Event->EventID, Event->TransportStreamID,
+ Event->ServiceID, Event->StartTime,
+ Event->Duration, Event->Status);
+ }
+
switch (Descriptor->Tag)
{
case DESCR_SHORT_EVENT:
@@ -67,43 +77,29 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
if (!xName(Descriptor) || !xName(Descriptor)[0])
break;
- if (!VdrProgramInfo)
- {
- CreateVdrProgramInfo(VdrProgramInfo,
- Event->EventID, Event->TransportStreamID,
- Event->ServiceID, Event->StartTime,
- Event->Duration, Event->Status);
-
- VdrProgramInfo->ShortName =
- xSetText (xName (Descriptor));
- VdrProgramInfo->ShortText =
- xSetText (((struct ShortEventDescriptor
- *)Descriptor)->Text);
- memcpy (VdrProgramInfo->LanguageCode, ((struct
- ShortEventDescriptor *)Descriptor)->
- LanguageCode, 4);
- }
- }
+ VdrProgramInfo->ShortName =
+ xSetText (xName (Descriptor));
+ VdrProgramInfo->ShortText =
+ xSetText (((struct ShortEventDescriptor
+ *)Descriptor)->Text);
+ memcpy (VdrProgramInfo->LanguageCode, ((struct
+ ShortEventDescriptor *)Descriptor)->
+ LanguageCode, 4);
+ GotVdrProgramInfo = 1;
+ }
break;
case DESCR_TIME_SHIFTED_EVENT:
{
struct tm *StartTime;
- if (!VdrProgramInfo)
- {
- CreateVdrProgramInfo(VdrProgramInfo,
- Event->EventID, Event->TransportStreamID,
- Event->ServiceID, Event->StartTime,
- Event->Duration, Event->Status);
-
- VdrProgramInfo->ReferenceServiceID =
- ((struct TimeShiftedEventDescriptor
- *)Descriptor)->ReferenceServiceID;
- VdrProgramInfo->ReferenceEventID =
- ((struct TimeShiftedEventDescriptor
- *)Descriptor)->ReferenceEventID;
- }
+ VdrProgramInfo->ReferenceServiceID =
+ ((struct TimeShiftedEventDescriptor
+ *)Descriptor)->ReferenceServiceID;
+ VdrProgramInfo->ReferenceEventID =
+ ((struct TimeShiftedEventDescriptor
+ *)Descriptor)->ReferenceEventID;
+ GotVdrProgramInfo = 1;
}
break;
@@ -111,20 +107,18 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
{
struct ExtendedEventItem *Item;
- if (VdrProgramInfo)
+ if (xName (Descriptor))
+ AddToText (xName (Descriptor),
+ VdrProgramInfo->ExtendedName);
+ xForeach (((struct ExtendedEventDescriptor*)
+ Descriptor)->Items, Item)
{
- if (xName (Descriptor))
- AddToText (xName (Descriptor),
- VdrProgramInfo->ExtendedName);
- xForeach (((struct ExtendedEventDescriptor*)
- Descriptor)->Items, Item)
- {
- AddItemToText (xName (Item),
- VdrProgramInfo->ExtendedText);
- AddItemToText (Item->Text,
- VdrProgramInfo->ExtendedText);
- }
+ AddItemToText (xName (Item),
+ VdrProgramInfo->ExtendedText);
+ AddItemToText (Item->Text,
+ VdrProgramInfo->ExtendedText);
}
+ GotVdrProgramInfo = 1;
}
break;
@@ -132,37 +126,33 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
{
int i, j;
- if (VdrProgramInfo)
+ for (j = 0; j < ((struct ContentDescriptor*)
+ Descriptor)->Amount; j++)
{
- for (j = 0; j < ((struct ContentDescriptor*)
- Descriptor)->Amount; j++)
- {
- VdrProgramInfo->ContentNibble1 =
- GetContentContentNibble1(Descriptor, j);
- VdrProgramInfo->ContentNibble2 =
- GetContentContentNibble2(Descriptor, j);
- }
+ VdrProgramInfo->ContentNibble1 =
+ GetContentContentNibble1(Descriptor, j);
+ VdrProgramInfo->ContentNibble2 =
+ GetContentContentNibble2(Descriptor, j);
}
+ GotVdrProgramInfo = 1;
}
break;
case DESCR_PARENTAL_RATING:
{
struct ParentalRating *Rating;
-
- if (VdrProgramInfo)
- {
- xForeach (((struct ParentalRatingDescriptor *)
- Descriptor)->Ratings, Rating)
- if (!strncmp (VdrProgramInfo->LanguageCode,
- Rating->LanguageCode, 3))
- VdrProgramInfo->Rating = Rating->Rating;
- }
+
+ xForeach (((struct ParentalRatingDescriptor *)
+ Descriptor)->Ratings, Rating)
+ if (!strncmp (VdrProgramInfo->LanguageCode,
+ Rating->LanguageCode, 3))
+ VdrProgramInfo->Rating = Rating->Rating;
+ GotVdrProgramInfo = 1;
}
break;
}
- }
- if (VdrProgramInfo) xAddTail (Result, VdrProgramInfo);
+ }
+ if (GotVdrProgramInfo) xAddTail (Result, VdrProgramInfo);
}
return (Result);