1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Modified cSchedule::Cleanup() (events are always sorted by time)

This commit is contained in:
Klaus Schmidinger 2005-12-26 15:09:21 +01:00
parent 56f4907309
commit 2d5f3497bf
2 changed files with 8 additions and 10 deletions

View File

@ -3996,3 +3996,4 @@ Video Disk Recorder Revision History
- EPG events that are no longer in the currently broadcasted data stream are - EPG events that are no longer in the currently broadcasted data stream are
now automatically deleted. now automatically deleted.
- Removed an invalid access to Event->schedule in cSchedule::DelEvent(). - Removed an invalid access to Event->schedule in cSchedule::DelEvent().
- Modified cSchedule::Cleanup() (events are always sorted by time).

13
epg.c
View File

@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by * Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* *
* $Id: epg.c 1.43 2005/12/26 14:47:55 kls Exp $ * $Id: epg.c 1.44 2005/12/26 15:09:03 kls Exp $
*/ */
#include "epg.h" #include "epg.h"
@ -767,14 +767,11 @@ void cSchedule::Cleanup(void)
void cSchedule::Cleanup(time_t Time) void cSchedule::Cleanup(time_t Time)
{ {
cEvent *Event; cEvent *Event;
for (int a = 0; true ; a++) { while ((Event = events.First()) != NULL) {
Event = events.Get(a); if (!Event->HasTimer() && Event->EndTime() + Setup.EPGLinger * 60 + 3600 < Time) // adding one hour for safety
if (!Event)
break;
if (!Event->HasTimer() && Event->EndTime() + Setup.EPGLinger * 60 + 3600 < Time) { // adding one hour for safety
DelEvent(Event); DelEvent(Event);
a--; else
} break;
} }
} }