diff --git a/HISTORY b/HISTORY index e2912dab..53861b24 100644 --- a/HISTORY +++ b/HISTORY @@ -3513,7 +3513,7 @@ Video Disk Recorder Revision History - Fixed a wrong inheritance in libsi's SubtitlingDescriptor::Subtitling (thanks to Marco Schlüßler). -2005-05-26: Version 1.3.25 +2005-05-28: Version 1.3.25 - Updated the Estonian OSD texts (thanks to Arthur Konovalov). - Some cable providers don't mark short channel names according to the standard, @@ -3566,3 +3566,5 @@ Video Disk Recorder Revision History - Made tChannelID::operator==() inline for better performance (thanks to Georg Acher). - Introduced cListBase::count for better performance (thanks to Georg Acher). +- cEvent no longer stores the channelID directly, but rather has a pointer to + the schedule it is in. diff --git a/eit.c b/eit.c index 2426234a..d43a2013 100644 --- a/eit.c +++ b/eit.c @@ -8,7 +8,7 @@ * Robert Schneider and Rolf Hakenes . * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg . * - * $Id: eit.c 1.105 2005/05/26 10:25:41 kls Exp $ + * $Id: eit.c 1.106 2005/05/28 10:07:12 kls Exp $ */ #include "eit.h" @@ -56,7 +56,7 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data) if (!pEvent) { // 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())); + pEvent = pSchedule->AddEvent(new cEvent(pSchedule, SiEitEvent.getEventId())); if (!pEvent) continue; } diff --git a/epg.c b/epg.c index 5546bf96..440e7fa0 100644 --- a/epg.c +++ b/epg.c @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.c 1.31 2005/05/28 09:49:04 kls Exp $ + * $Id: epg.c 1.32 2005/05/28 10:03:39 kls Exp $ */ #include "epg.h" @@ -81,9 +81,9 @@ void cComponents::SetComponent(int Index, uchar Stream, uchar Type, const char * // --- cEvent ---------------------------------------------------------------- -cEvent::cEvent(tChannelID ChannelID, u_int16_t EventID) +cEvent::cEvent(cSchedule *Schedule, u_int16_t EventID) { - channelID = ChannelID; + schedule = Schedule; eventID = EventID; tableID = 0; version = 0xFF; // actual version numbers are 0..31 @@ -112,6 +112,11 @@ int cEvent::Compare(const cListObject &ListObject) const return startTime - e->startTime; } +tChannelID cEvent::ChannelID(void) const +{ + return schedule ? schedule->ChannelID() : tChannelID(); +} + void cEvent::SetEventID(u_int16_t EventID) { eventID = EventID; @@ -281,7 +286,7 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule) if (n == 3 || n == 4) { Event = (cEvent *)Schedule->GetEvent(EventID, StartTime); if (!Event) - Event = Schedule->AddEvent(new cEvent(Schedule->ChannelID(), EventID)); + Event = Schedule->AddEvent(new cEvent(Schedule, EventID)); if (Event) { Event->SetTableID(TableID); Event->SetStartTime(StartTime); diff --git a/epg.h b/epg.h index f0836946..1b65e637 100644 --- a/epg.h +++ b/epg.h @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.h 1.23 2005/05/28 09:48:56 kls Exp $ + * $Id: epg.h 1.24 2005/05/28 10:00:12 kls Exp $ */ #ifndef __EPG_H @@ -48,7 +48,7 @@ class cSchedule; class cEvent : public cListObject { private: - tChannelID channelID; // Channel ID of program for this event + cSchedule *schedule; // The Schedule this event belongs to u_int16_t eventID; // Event ID of this event uchar tableID; // Table ID this event came from uchar version; // Version number of section this event came from @@ -62,10 +62,10 @@ private: time_t vps; // Video Programming Service timestamp (VPS, aka "Programme Identification Label", PIL) time_t seen; // When this event was last seen in the data stream public: - cEvent(tChannelID ChannelID, u_int16_t EventID); + cEvent(cSchedule *Schedule, u_int16_t EventID); ~cEvent(); virtual int Compare(const cListObject &ListObject) const; - tChannelID ChannelID(void) const { return channelID; } + tChannelID ChannelID(void) const; u_int16_t EventID(void) const { return eventID; } uchar TableID(void) const { return tableID; } uchar Version(void) const { return version; } diff --git a/recording.c b/recording.c index 64335649..cefbef02 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 1.104 2005/05/28 09:53:54 kls Exp $ + * $Id: recording.c 1.105 2005/05/28 10:04:24 kls Exp $ */ #include "recording.h" @@ -228,7 +228,7 @@ cRecordingInfo::cRecordingInfo(const cEvent *Event) ownEvent = NULL; } else - event = ownEvent = new cEvent(tChannelID(), 0); + event = ownEvent = new cEvent(NULL, 0); } cRecordingInfo::~cRecordingInfo()