summaryrefslogtreecommitdiff
path: root/libdtv
diff options
context:
space:
mode:
Diffstat (limited to 'libdtv')
-rw-r--r--libdtv/liblx/liblx.h53
-rw-r--r--libdtv/liblx/xListFuncs.c53
-rw-r--r--libdtv/liblx/xMemMgt.c53
-rw-r--r--libdtv/libsi/include/libsi.h60
-rw-r--r--libdtv/libsi/include/si_tables.h36
-rw-r--r--libdtv/libsi/si_debug_services.c37
-rw-r--r--libdtv/libsi/si_parser.c66
-rw-r--r--libdtv/libvdr/libvdr.c120
8 files changed, 327 insertions, 151 deletions
diff --git a/libdtv/liblx/liblx.h b/libdtv/liblx/liblx.h
index 26ea664..2e12295 100644
--- a/libdtv/liblx/liblx.h
+++ b/libdtv/liblx/liblx.h
@@ -1,29 +1,30 @@
-//////////////////////////////////////////////////////////////
-/// ///
-/// liblx.h: definitions necessary for the liblx package ///
-/// ///
-//////////////////////////////////////////////////////////////
-
-// $Revision: 1.2 $
-// $Date: 2001/06/25 19:39:00 $
-// $Author: hakenes $
-//
-// (C) 1992-2001 Rolf Hakenes <hakenes@hippomi.de>, under the GNU GPL.
-//
-// liblx is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-// liblx is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You may have received a copy of the GNU General Public License
-// along with liblx; see the file COPYING. If not, write to the
-// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
+/*
+ *
+ * liblx.h: definitions necessary for the liblx package
+ *
+ *
+ * $Revision: 1.2 $
+ * $Date: 2001/06/25 19:39:00 $
+ * $Author: hakenes $
+ *
+ * (C) 1992-2001 Rolf Hakenes <hakenes@hippomi.de>, under the GNU GPL.
+ *
+ * liblx is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * liblx is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You may have received a copy of the GNU General Public License
+ * along with liblx; see the file COPYING. If not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
#ifndef LIBLX_H
#define LIBLX_H
diff --git a/libdtv/liblx/xListFuncs.c b/libdtv/liblx/xListFuncs.c
index 01b85b8..88a908b 100644
--- a/libdtv/liblx/xListFuncs.c
+++ b/libdtv/liblx/xListFuncs.c
@@ -1,29 +1,30 @@
-//////////////////////////////////////////////////////////////
-/// ///
-/// xListFuncs.c: list handling functions of liblx ///
-/// ///
-//////////////////////////////////////////////////////////////
-
-// $Revision: 1.1 $
-// $Date: 2001/06/25 12:29:47 $
-// $Author: hakenes $
-//
-// (C) 1992-2001 Rolf Hakenes <hakenes@hippomi.de>, under the GNU GPL.
-//
-// liblx is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-// liblx is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You may have received a copy of the GNU General Public License
-// along with liblx; see the file COPYING. If not, write to the
-// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
+/*
+ *
+ * xListFuncs.c: list handling functions of liblx
+ *
+ *
+ * $Revision: 1.1 $
+ * $Date: 2001/06/25 12:29:47 $
+ * $Author: hakenes $
+ *
+ * (C) 1992-2001 Rolf Hakenes <hakenes@hippomi.de>, under the GNU GPL.
+ *
+ * liblx is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * liblx is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You may have received a copy of the GNU General Public License
+ * along with liblx; see the file COPYING. If not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
#include <string.h>
#include "liblx.h"
diff --git a/libdtv/liblx/xMemMgt.c b/libdtv/liblx/xMemMgt.c
index c93713b..b1b07de 100644
--- a/libdtv/liblx/xMemMgt.c
+++ b/libdtv/liblx/xMemMgt.c
@@ -1,29 +1,30 @@
-//////////////////////////////////////////////////////////////
-/// ///
-/// xMemMgt.c: memory management functions of liblx ///
-/// ///
-//////////////////////////////////////////////////////////////
-
-// $Revision: 1.1 $
-// $Date: 2001/06/25 12:29:47 $
-// $Author: hakenes $
-//
-// (C) 1992-2001 Rolf Hakenes <hakenes@hippomi.de>, under the GNU GPL.
-//
-// liblx is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-// liblx is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You may have received a copy of the GNU General Public License
-// along with liblx; see the file COPYING. If not, write to the
-// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
+/*
+ *
+ * xMemMgt.c: memory management functions of liblx
+ *
+ *
+ * $Revision: 1.1 $
+ * $Date: 2001/06/25 12:29:47 $
+ * $Author: hakenes $
+ *
+ * (C) 1992-2001 Rolf Hakenes <hakenes@hippomi.de>, under the GNU GPL.
+ *
+ * liblx is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * liblx is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You may have received a copy of the GNU General Public License
+ * along with liblx; see the file COPYING. If not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
#include <stdio.h>
#include <stdlib.h>
diff --git a/libdtv/libsi/include/libsi.h b/libdtv/libsi/include/libsi.h
index 715d18b..b2f8ba2 100644
--- a/libdtv/libsi/include/libsi.h
+++ b/libdtv/libsi/include/libsi.h
@@ -1037,23 +1037,81 @@ struct SatelliteDeliverySystemDescriptor {
unsigned short Tag;
long Frequency;
short OrbitalPosition;
+ short Modulation;
char Polarization;
long SymbolRate;
char FEC;
};
-#define CreateSatelliteDeliverySystemDescriptor(descr, freq, orb, polar, sr, fec) \
+#define CreateSatelliteDeliverySystemDescriptor(descr, freq, orb, mod, polar, sr, fec) \
do \
{ \
xCreateNode (((struct SatelliteDeliverySystemDescriptor *)descr), NULL); \
((struct SatelliteDeliverySystemDescriptor *)descr)->Tag = DESCR_SAT_DEL_SYS; \
((struct SatelliteDeliverySystemDescriptor *)descr)->Frequency = freq; \
((struct SatelliteDeliverySystemDescriptor *)descr)->OrbitalPosition = orb; \
+ ((struct SatelliteDeliverySystemDescriptor *)descr)->Modulation = mod; \
((struct SatelliteDeliverySystemDescriptor *)descr)->Polarization = polar; \
((struct SatelliteDeliverySystemDescriptor *)descr)->SymbolRate = sr; \
((struct SatelliteDeliverySystemDescriptor *)descr)->FEC = fec; \
} while (0)
+/* CableDeliverySystemDescriptor */
+
+struct CableDeliverySystemDescriptor {
+ struct NODE Node;
+ unsigned short Tag;
+ long Frequency;
+ long SymbolRate;
+ char FECouter;
+ char FECinner;
+ char Modulation;
+};
+
+#define CreateCableDeliverySystemDescriptor(descr, freq, sr, fec_o, fec_i, mod) \
+ do \
+ { \
+ xCreateNode (((struct CableDeliverySystemDescriptor *)descr), NULL); \
+ ((struct CableDeliverySystemDescriptor *)descr)->Tag = DESCR_CABLE_DEL_SYS; \
+ ((struct CableDeliverySystemDescriptor *)descr)->Frequency = freq; \
+ ((struct CableDeliverySystemDescriptor *)descr)->SymbolRate = sr; \
+ ((struct CableDeliverySystemDescriptor *)descr)->FECouter = fec_o; \
+ ((struct CableDeliverySystemDescriptor *)descr)->FECinner = fec_i; \
+ ((struct CableDeliverySystemDescriptor *)descr)->Modulation = mod; \
+ } while (0)
+
+/* TerrestrialDeliverySystemDescriptor */
+
+struct TerrestrialDeliverySystemDescriptor {
+ struct NODE Node;
+ unsigned short Tag;
+ long Frequency;
+ char Bandwidth;
+ char Constellation;
+ char Hierarchy;
+ char CodeRateHP;
+ char CodeRateLP;
+ char GuardInterval;
+ char TransmissionMode;
+ char OtherFrequencyFlag;
+};
+
+#define CreateTerrestrialDeliverySystemDescriptor(descr, freq, bw, cst, hr, crh, crl, gi, tm, ofm) \
+ do \
+ { \
+ xCreateNode (((struct CableDeliverySystemDescriptor *)descr), NULL); \
+ ((struct TerrestrialDeliverySystemDescriptor *)descr)->Tag = DESCR_TERR_DEL_SYS; \
+ ((struct TerrestrialDeliverySystemDescriptor *)descr)->Frequency = freq; \
+ ((struct TerrestrialDeliverySystemDescriptor *)descr)->Bandwidth = bw; \
+ ((struct TerrestrialDeliverySystemDescriptor *)descr)->Constellation = cst; \
+ ((struct TerrestrialDeliverySystemDescriptor *)descr)->Hierarchy = hr; \
+ ((struct TerrestrialDeliverySystemDescriptor *)descr)->CodeRateHP = crh; \
+ ((struct TerrestrialDeliverySystemDescriptor *)descr)->CodeRateLP = crl; \
+ ((struct TerrestrialDeliverySystemDescriptor *)descr)->GuardInterval = gi; \
+ ((struct TerrestrialDeliverySystemDescriptor *)descr)->TransmissionMode = tm; \
+ ((struct TerrestrialDeliverySystemDescriptor *)descr)->OtherFrequencyFlag = ofm; \
+ } while (0)
+
/* ServiceListDescriptor */
struct ServiceListDescriptor {
diff --git a/libdtv/libsi/include/si_tables.h b/libdtv/libsi/include/si_tables.h
index b7cfea2..24c316d 100644
--- a/libdtv/libsi/include/si_tables.h
+++ b/libdtv/libsi/include/si_tables.h
@@ -1126,7 +1126,41 @@ typedef struct item_subtitling_struct {
typedef struct descr_terrestrial_delivery_struct {
u_char descriptor_tag :8;
u_char descriptor_length :8;
- /* TBD */
+ u_char frequency1 :8;
+ u_char frequency2 :8;
+ u_char frequency3 :8;
+ u_char frequency4 :8;
+#if BYTE_ORDER == BIG_ENDIAN
+ u_char bandwidth :3;
+ u_char reserved1 :5;
+#else
+ u_char reserved1 :5;
+ u_char bandwidth :3;
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ u_char constellation :2;
+ u_char hierarchy :3;
+ u_char code_rate_HP :3;
+#else
+ u_char code_rate_HP :3;
+ u_char hierarchy :3;
+ u_char constellation :2;
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ u_char code_rate_LP :3;
+ u_char guard_interval :2;
+ u_char transmission_mode :2;
+ u_char other_frequency_flag :1;
+#else
+ u_char other_frequency_flag :1;
+ u_char transmission_mode :2;
+ u_char guard_interval :2;
+ u_char code_rate_LP :3;
+#endif
+ u_char reserver2 :8;
+ u_char reserver3 :8;
+ u_char reserver4 :8;
+ u_char reserver5 :8;
} descr_terrestrial_delivery_system_t;
#define CastTerrestrialDeliverySystemDescriptor(x) ((descr_terrestrial_delivery_system_t *)(x))
diff --git a/libdtv/libsi/si_debug_services.c b/libdtv/libsi/si_debug_services.c
index ac8de34..1ff7400 100644
--- a/libdtv/libsi/si_debug_services.c
+++ b/libdtv/libsi/si_debug_services.c
@@ -535,11 +535,44 @@ void siDebugDescriptors (char *Prepend, struct LIST *Descriptors)
printf ("%s Frequency: %ld\n", Prepend, sds->Frequency);
printf ("%s OrbitalPosition: %d\n", Prepend, sds->OrbitalPosition);
printf ("%s Polarization: %c\n", Prepend, sds->Polarization);
+ printf ("%s Modulation: %c\n", Prepend, sds->Modulation);
printf ("%s SymbolRate: %ld\n", Prepend, sds->SymbolRate);
printf ("%s FEC: %c\n", Prepend, sds->FEC);
}
break;
+ case DESCR_CABLE_DEL_SYS:
+ {
+ struct CableDeliverySystemDescriptor *cds =
+ (struct CableDeliverySystemDescriptor *)Descriptor;
+
+ printf ("%sDescriptor: Cable Delivery System\n", Prepend);
+ printf ("%s Frequency: %ld\n", Prepend, cds->Frequency);
+ printf ("%s SymbolRate: %ld\n", Prepend, cds->SymbolRate);
+ printf ("%s FEC outer: %d\n", Prepend, cds->FECouter);
+ printf ("%s FEC inner: %d\n", Prepend, cds->FECinner);
+ printf ("%s Modulation: %d\n", Prepend, cds->Modulation);
+ }
+ break;
+
+ case DESCR_TERR_DEL_SYS:
+ {
+ struct TerrestrialDeliverySystemDescriptor *tds =
+ (struct TerrestrialDeliverySystemDescriptor *)Descriptor;
+
+ printf ("%sDescriptor: Terrestrial Delivery System\n", Prepend);
+ printf ("%s Frequency: %ld\n", Prepend, tds->Frequency);
+ printf ("%s Bandwidth: %d\n", Prepend, tds->Bandwidth);
+ printf ("%s Constellation: %d\n", Prepend, tds->Constellation);
+ printf ("%s Hierarchy: %d\n", Prepend, tds->Hierarchy);
+ printf ("%s CodeRateHP: %d\n", Prepend, tds->CodeRateHP);
+ printf ("%s CodeRateLP: %d\n", Prepend, tds->CodeRateLP);
+ printf ("%s GuardInterval: %d\n", Prepend, tds->GuardInterval);
+ printf ("%s TransmissionMode: %d\n", Prepend, tds->TransmissionMode);
+ printf ("%s OtherFrequencyFlag: %d\n", Prepend, tds->OtherFrequencyFlag);
+ }
+ break;
+
case DESCR_SERVICE_LIST:
{
struct ServiceListEntry *Entry;
@@ -572,12 +605,10 @@ void siDebugDescriptors (char *Prepend, struct LIST *Descriptors)
break;
case DESCR_STUFFING:
- case DESCR_CABLE_DEL_SYS:
case DESCR_VBI_DATA:
case DESCR_VBI_TELETEXT:
case DESCR_MOSAIC:
case DESCR_TELEPHONE:
- case DESCR_TERR_DEL_SYS:
case DESCR_ML_NW_NAME:
case DESCR_ML_BQ_NAME:
case DESCR_ML_SERVICE_NAME:
@@ -598,7 +629,7 @@ void siDebugDescriptors (char *Prepend, struct LIST *Descriptors)
case DESCR_CELL_FREQ_LINK:
case DESCR_ANNOUNCEMENT_SUPPORT:
default:
- printf ("%sDescriptor: (noch nicht unterstützt)\n", Prepend);
+ printf ("%sDescriptor: %02x (noch nicht unterstützt)\n", Prepend, DescriptorTag (Descriptor));
break;
}
}
diff --git a/libdtv/libsi/si_parser.c b/libdtv/libsi/si_parser.c
index e8cf8b2..a922b7e 100644
--- a/libdtv/libsi/si_parser.c
+++ b/libdtv/libsi/si_parser.c
@@ -1050,6 +1050,7 @@ void siParseDescriptor (struct LIST *Descriptors, u_char *Buffer)
(sds->west_east_flag ? 1 : -1) *
(BcdCharToInt (sds->orbital_position1) * 100 +
BcdCharToInt (sds->orbital_position2)),
+ sds->modulation,
sds->polarization,
BcdCharToInt (sds->symbol_rate1) * 10 * 1000 +
BcdCharToInt (sds->symbol_rate2) * 100 +
@@ -1064,6 +1065,68 @@ void siParseDescriptor (struct LIST *Descriptors, u_char *Buffer)
}
break;
+ case DESCR_CABLE_DEL_SYS:
+// fprintf (stderr, "got descriptor 0x%x\n", GetDescriptorTag(Buffer));
+ {
+ descr_cable_delivery_system_t *cds;
+ cds = (descr_cable_delivery_system_t *) Ptr;
+ if (CheckBcdChar (cds->frequency1) && CheckBcdChar (cds->frequency2) &&
+ CheckBcdChar (cds->frequency3) && CheckBcdChar (cds->frequency4) &&
+ CheckBcdChar (cds->symbol_rate1) && CheckBcdChar (cds->symbol_rate1) &&
+ CheckBcdChar (cds->symbol_rate3) && (cds->fec_inner != 0))
+ {
+ CreateCableDeliverySystemDescriptor (Descriptor,
+ BcdCharToInt (cds->frequency1) * 100 * 1000 * 1000 +
+ BcdCharToInt (cds->frequency2) * 1000 * 1000 +
+ BcdCharToInt (cds->frequency3) * 10 * 1000 +
+ BcdCharToInt (cds->frequency4) * 100,
+ BcdCharToInt (cds->symbol_rate1) * 10 * 1000 +
+ BcdCharToInt (cds->symbol_rate2) * 100 +
+ BcdCharToInt (cds->symbol_rate3),
+ cds->fec_outer,
+ cds->fec_inner,
+ cds->modulation
+ );
+ }
+ /* else
+ {
+ fprintf (stderr, "Illegal cds descriptor\n");
+ siDumpDescriptor (Buffer);
+ } */
+ }
+ break;
+
+ case DESCR_TERR_DEL_SYS:
+// fprintf (stderr, "got descriptor 0x%x\n", GetDescriptorTag(Buffer));
+ {
+ descr_terrestrial_delivery_system_t *tds;
+ tds = (descr_terrestrial_delivery_system_t *) Ptr;
+ if (CheckBcdChar (tds->frequency1) && CheckBcdChar (tds->frequency2) &&
+ CheckBcdChar (tds->frequency3) && CheckBcdChar (tds->frequency4))
+ {
+ CreateTerrestrialDeliverySystemDescriptor (Descriptor,
+ BcdCharToInt (tds->frequency1) * 100 * 1000 * 1000 +
+ BcdCharToInt (tds->frequency2) * 1000 * 1000 +
+ BcdCharToInt (tds->frequency3) * 10 * 1000 +
+ BcdCharToInt (tds->frequency4) * 100,
+ tds->bandwidth,
+ tds->constellation,
+ tds->hierarchy,
+ tds->code_rate_HP,
+ tds->code_rate_LP,
+ tds->guard_interval,
+ tds->transmission_mode,
+ tds->other_frequency_flag
+ );
+ }
+ /* else
+ {
+ fprintf (stderr, "Illegal cds descriptor\n");
+ siDumpDescriptor (Buffer);
+ } */
+ }
+ break;
+
case DESCR_SERVICE_LIST:
// fprintf (stderr, "got descriptor 0x%x\n", GetDescriptorTag(Buffer));
CreateServiceListDescriptor (Descriptor);
@@ -1119,12 +1182,10 @@ void siParseDescriptor (struct LIST *Descriptors, u_char *Buffer)
case DESCR_SMOOTHING_BUFFER:
case DESCR_STD:
case DESCR_IBP:
- case DESCR_CABLE_DEL_SYS:
case DESCR_VBI_DATA:
case DESCR_VBI_TELETEXT:
case DESCR_MOSAIC:
case DESCR_TELEPHONE:
- case DESCR_TERR_DEL_SYS:
case DESCR_ML_NW_NAME:
case DESCR_ML_BQ_NAME:
case DESCR_ML_SERVICE_NAME:
@@ -1181,7 +1242,6 @@ char *siGetDescriptorTextHandler (u_char *Buffer, int Length, int type)
if ((*Buffer >= ' ' && *Buffer <= '~') || (*Buffer == '\n') ||
(*Buffer >= 0xa0 && *Buffer <= 0xff)) *tmp++ = *Buffer;
if (*Buffer == 0x8A) *tmp++ = '\n';
- if (*Buffer == 0x86 || *Buffer == 0x87) *tmp++ = ' ';
if ((*Buffer == 0x86 || *Buffer == 0x87) && !(GDT_NAME_DESCRIPTOR & type)) *tmp++ = ' ';
Buffer++;
}
diff --git a/libdtv/libvdr/libvdr.c b/libdtv/libvdr/libvdr.c
index 0ade4d3..e041fd8 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);