Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] Re: Descriptor odering bug in libvdr.c / createVdrProgramInfos() ?
> > Hello,
> >
> > I am having a problem with VDR not showing the extended event descriptor
> > information in the schedule menu. It appears that libvdr.c makes
> > an assumption on the ordering of the EIT descriptors processed in
> > createVdrProgramInfos . If the extended event descriptor 0x4E comes before the
> > short event 0x4D or a time shifted event then VdrProgramInfo struct is not
> > created and the data lost. Only cases of DESCR_SHORT_EVENT and
> > DESCR_TIME_SHIFTED_EVENT create this struct. Perhaps each case statement
> > should conditionally create the VdrProgramInfo or you can move
> > CreateVdrProgramInfo() out of the descriptor cases and before the switch
> > statement which fixed the problem for me.
>
> Is there a channel on Astra 19.2 east where I could observe this?
> Can you please send me a patch that implements your fix?
>
> Klaus
> --
Hello,
Sorry I can only reach the north american sats from U.S. so I can't give
examples for your location. Basically when processing a group of
descriptors the 'case DESCR_EXTENDED_EVENT' comes first so 'if (VdrProgramInfo)'
fails because VdrProgramInfo is only created in
'DESCR_TIME_SHIFTED_EVENT' and 'DESCR_TIME_SHORT_EVENT'.
The patch is attached. Problaby a better way to do it but it works.
-Jonan
--- vdr-1.1.30/libdtv/libvdr/libvdr.c.dist 2003-05-08 05:00:08.000000000 -0400
+++ vdr-1.1.30/libdtv/libvdr/libvdr.c 2003-05-08 06:10:06.000000000 -0400
@@ -47,7 +47,8 @@
struct LIST *Result, *EventList;
struct Event *Event;
struct Descriptor *Descriptor;
-
+ unsigned char VdrProgramInfoFlag;
+
if (!siBuffer) return (NULL);
if (!(EventList = siParseEIT (siBuffer))) return (NULL);
@@ -57,9 +58,19 @@
xForeach (EventList, Event)
{
VdrProgramInfo = NULL;
-
+ VdrProgramInfoFlag = 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 +78,29 @@
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);
+ VdrProgramInfoFlag=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;
+ VdrProgramInfoFlag=1;
}
break;
@@ -111,20 +108,18 @@
{
struct ExtendedEventItem *Item;
- if (VdrProgramInfo)
- {
- if (xName (Descriptor))
- AddToText (xName (Descriptor),
- VdrProgramInfo->ExtendedName);
- xForeach (((struct ExtendedEventDescriptor*)
- Descriptor)->Items, Item)
- {
- AddItemToText (xName (Item),
- VdrProgramInfo->ExtendedText);
- AddItemToText (Item->Text,
- VdrProgramInfo->ExtendedText);
- }
- }
+ if (xName (Descriptor))
+ AddToText (xName (Descriptor),
+ VdrProgramInfo->ExtendedName);
+ xForeach (((struct ExtendedEventDescriptor*)
+ Descriptor)->Items, Item)
+ {
+ AddItemToText (xName (Item),
+ VdrProgramInfo->ExtendedText);
+ AddItemToText (Item->Text,
+ VdrProgramInfo->ExtendedText);
+ }
+ VdrProgramInfoFlag=1;
}
break;
@@ -132,37 +127,33 @@
{
int i, j;
- if (VdrProgramInfo)
- {
- for (j = 0; j < ((struct ContentDescriptor*)
- Descriptor)->Amount; j++)
- {
- VdrProgramInfo->ContentNibble1 =
- GetContentContentNibble1(Descriptor, j);
- VdrProgramInfo->ContentNibble2 =
- GetContentContentNibble2(Descriptor, j);
- }
- }
+ for (j = 0; j < ((struct ContentDescriptor*)
+ Descriptor)->Amount; j++)
+ {
+ VdrProgramInfo->ContentNibble1 =
+ GetContentContentNibble1(Descriptor, j);
+ VdrProgramInfo->ContentNibble2 =
+ GetContentContentNibble2(Descriptor, j);
+ }
+ VdrProgramInfoFlag=1;
}
break;
- case DESCR_PARENTAL_RATING:
- {
+ 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;
+ VdrProgramInfoFlag=1;
}
break;
}
- }
- if (VdrProgramInfo) xAddTail (Result, VdrProgramInfo);
+ }
+ if (VdrProgramInfoFlag) xAddTail (Result, VdrProgramInfo);
}
return (Result);
Home |
Main Index |
Thread Index