Fixed handling EPG data where the 'extended event descriptor' comes before the 'short event' or a 'time shifted event'

This commit is contained in:
Klaus Schmidinger 2003-05-11 11:19:37 +02:00
parent e3e21837d0
commit afd0dd904b
3 changed files with 61 additions and 65 deletions

View File

@ -639,3 +639,7 @@ Carsten Siebholz <c.siebholz@t-online.de>
Wolfgang Goeller <wgoeller@heraklit.ch> Wolfgang Goeller <wgoeller@heraklit.ch>
for reporting a bug in keeping live video active in case the primary device doesn't for reporting a bug in keeping live video active in case the primary device doesn't
have an MPEG decoder 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"

View File

@ -2129,3 +2129,5 @@ Video Disk Recorder Revision History
dvbplayer.c. Also, the long timeout in WaitForPut caused problems with cReceivers 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 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). 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).

View File

@ -47,6 +47,7 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
struct LIST *Result, *EventList; struct LIST *Result, *EventList;
struct Event *Event; struct Event *Event;
struct Descriptor *Descriptor; struct Descriptor *Descriptor;
int GotVdrProgramInfo;
if (!siBuffer) return (NULL); if (!siBuffer) return (NULL);
@ -57,22 +58,24 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
xForeach (EventList, Event) xForeach (EventList, Event)
{ {
VdrProgramInfo = NULL; VdrProgramInfo = NULL;
GotVdrProgramInfo = 0;
xForeach (Event->Descriptors, Descriptor) xForeach (Event->Descriptors, Descriptor)
{ {
switch (Descriptor->Tag)
{
case DESCR_SHORT_EVENT:
{
if (!xName(Descriptor) || !xName(Descriptor)[0])
break;
if (!VdrProgramInfo) if (!VdrProgramInfo)
{ {
CreateVdrProgramInfo(VdrProgramInfo, CreateVdrProgramInfo(VdrProgramInfo,
Event->EventID, Event->TransportStreamID, Event->EventID, Event->TransportStreamID,
Event->ServiceID, Event->StartTime, Event->ServiceID, Event->StartTime,
Event->Duration, Event->Status); Event->Duration, Event->Status);
}
switch (Descriptor->Tag)
{
case DESCR_SHORT_EVENT:
{
if (!xName(Descriptor) || !xName(Descriptor)[0])
break;
VdrProgramInfo->ShortName = VdrProgramInfo->ShortName =
xSetText (xName (Descriptor)); xSetText (xName (Descriptor));
@ -82,7 +85,7 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
memcpy (VdrProgramInfo->LanguageCode, ((struct memcpy (VdrProgramInfo->LanguageCode, ((struct
ShortEventDescriptor *)Descriptor)-> ShortEventDescriptor *)Descriptor)->
LanguageCode, 4); LanguageCode, 4);
} GotVdrProgramInfo = 1;
} }
break; break;
@ -90,20 +93,13 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
{ {
struct tm *StartTime; struct tm *StartTime;
if (!VdrProgramInfo)
{
CreateVdrProgramInfo(VdrProgramInfo,
Event->EventID, Event->TransportStreamID,
Event->ServiceID, Event->StartTime,
Event->Duration, Event->Status);
VdrProgramInfo->ReferenceServiceID = VdrProgramInfo->ReferenceServiceID =
((struct TimeShiftedEventDescriptor ((struct TimeShiftedEventDescriptor
*)Descriptor)->ReferenceServiceID; *)Descriptor)->ReferenceServiceID;
VdrProgramInfo->ReferenceEventID = VdrProgramInfo->ReferenceEventID =
((struct TimeShiftedEventDescriptor ((struct TimeShiftedEventDescriptor
*)Descriptor)->ReferenceEventID; *)Descriptor)->ReferenceEventID;
} GotVdrProgramInfo = 1;
} }
break; break;
@ -111,8 +107,6 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
{ {
struct ExtendedEventItem *Item; struct ExtendedEventItem *Item;
if (VdrProgramInfo)
{
if (xName (Descriptor)) if (xName (Descriptor))
AddToText (xName (Descriptor), AddToText (xName (Descriptor),
VdrProgramInfo->ExtendedName); VdrProgramInfo->ExtendedName);
@ -124,7 +118,7 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
AddItemToText (Item->Text, AddItemToText (Item->Text,
VdrProgramInfo->ExtendedText); VdrProgramInfo->ExtendedText);
} }
} GotVdrProgramInfo = 1;
} }
break; break;
@ -132,8 +126,6 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
{ {
int i, j; int i, j;
if (VdrProgramInfo)
{
for (j = 0; j < ((struct ContentDescriptor*) for (j = 0; j < ((struct ContentDescriptor*)
Descriptor)->Amount; j++) Descriptor)->Amount; j++)
{ {
@ -142,7 +134,7 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
VdrProgramInfo->ContentNibble2 = VdrProgramInfo->ContentNibble2 =
GetContentContentNibble2(Descriptor, j); GetContentContentNibble2(Descriptor, j);
} }
} GotVdrProgramInfo = 1;
} }
break; break;
@ -150,19 +142,17 @@ struct LIST *createVdrProgramInfos (unsigned char *siBuffer)
{ {
struct ParentalRating *Rating; struct ParentalRating *Rating;
if (VdrProgramInfo)
{
xForeach (((struct ParentalRatingDescriptor *) xForeach (((struct ParentalRatingDescriptor *)
Descriptor)->Ratings, Rating) Descriptor)->Ratings, Rating)
if (!strncmp (VdrProgramInfo->LanguageCode, if (!strncmp (VdrProgramInfo->LanguageCode,
Rating->LanguageCode, 3)) Rating->LanguageCode, 3))
VdrProgramInfo->Rating = Rating->Rating; VdrProgramInfo->Rating = Rating->Rating;
} GotVdrProgramInfo = 1;
} }
break; break;
} }
} }
if (VdrProgramInfo) xAddTail (Result, VdrProgramInfo); if (GotVdrProgramInfo) xAddTail (Result, VdrProgramInfo);
} }
return (Result); return (Result);