summaryrefslogtreecommitdiff
path: root/eit.c
diff options
context:
space:
mode:
Diffstat (limited to 'eit.c')
-rw-r--r--eit.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/eit.c b/eit.c
index c24a3d0a..857e06e3 100644
--- a/eit.c
+++ b/eit.c
@@ -8,7 +8,7 @@
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
*
- * $Id: eit.c 1.86 2004/02/08 10:26:54 kls Exp $
+ * $Id: eit.c 1.87 2004/02/21 12:20:26 kls Exp $
*/
#include "eit.h"
@@ -49,12 +49,11 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data)
cEvent *pEvent = (cEvent *)pSchedule->GetEvent(SiEitEvent.getEventId(), SiEitEvent.getStartTime());
if (!pEvent) {
- // If we don't have that event ID yet, we create a new one.
+ // If we don't have that event yet, we create a new one.
// Otherwise we copy the information into the existing event anyway, because the data might have changed.
pEvent = pSchedule->AddEvent(new cEvent(channelID, SiEitEvent.getEventId()));
if (!pEvent)
continue;
- pEvent->SetTableID(Tid);
}
else {
// We have found an existing event, either through its event ID or its start time.
@@ -62,19 +61,9 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data)
// not be overwritten.
if (pEvent->TableID() == 0x00)
continue;
- // If the new event comes from a table that belongs to an "other TS" and the existing
- // one comes from an "actual TS" table, let's skip it.
- #define ISACTUALTS(tid) (tid == 0x4E || (tid & 0x50) == 0x50)
- if (!ISACTUALTS(Tid) && ISACTUALTS(pEvent->TableID()))
- continue;
- // If the new event comes from a "schedule" table and the existing one comes from
- // a "present/following" table, let's skip it (the p/f table usually contains more
- // information, like e.g. a description).
- if ((Tid & 0x50) == 0x50 && pEvent->TableID() == 0x4E || (Tid & 0x60) == 0x60 && pEvent->TableID() == 0x4F)
- continue;
- // If both events come from the same "schedule" table and the new event's table id is larger than the
- // existing one's, let's skip it (higher tids mean "farther in the future" and usually have less information).
- if (((Tid & 0x50) == 0x50 || (Tid & 0x60) == 0x60) && (pEvent->TableID() & 0xF0) == (Tid & 0xF0) && (Tid > pEvent->TableID()))
+ // If the new event has a higher table ID, let's skip it.
+ // The lower the table ID, the more "current" the information.
+ if (Tid > pEvent->TableID())
continue;
// If the new event comes from the same table and has the same version number
// as the existing one, let's skip it to avoid unnecessary work.
@@ -85,9 +74,16 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data)
if (Tid == pEvent->TableID() && pEvent->Version() == getVersionNumber())
continue;
}
- pEvent->SetVersion(getVersionNumber());
- pEvent->SetTableID(Tid);
+ // XXX TODO log different (non-zero) event IDs for the same event???
pEvent->SetEventID(SiEitEvent.getEventId()); // unfortunately some stations use different event ids for the same event in different tables :-(
+ pEvent->SetTableID(Tid);
+ pEvent->SetVersion(getVersionNumber());
+ pEvent->SetStartTime(SiEitEvent.getStartTime());
+ pEvent->SetDuration(SiEitEvent.getDuration());
+ if (isPresentFollowing()) {
+ if (SiEitEvent.getRunningStatus() > SI::RunningStatusNotRunning)
+ pSchedule->SetRunningStatus(pEvent, SiEitEvent.getRunningStatus());
+ }
int LanguagePreferenceShort = -1;
int LanguagePreferenceExt = -1;
@@ -188,17 +184,8 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data)
delete ExtendedEventDescriptors;
delete ShortEventDescriptor;
- pEvent->SetStartTime(SiEitEvent.getStartTime());
- pEvent->SetDuration(SiEitEvent.getDuration());
pEvent->FixEpgBugs();
- if (isPresentFollowing()) {
- if (SiEitEvent.getRunningStatus() == SI::RunningStatusPausing || SiEitEvent.getRunningStatus() == SI::RunningStatusRunning)
- pSchedule->SetPresentEvent(pEvent);
- else if (SiEitEvent.getRunningStatus() == SI::RunningStatusStartsInAFewSeconds)
- pSchedule->SetFollowingEvent(pEvent);
- }
-
if (LinkChannels)
channel->SetLinkChannels(LinkChannels);
}