summaryrefslogtreecommitdiff
path: root/epg.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-12-27 10:26:38 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-12-27 10:26:38 +0100
commit2892300d94f4255f33ebf26866d28e1696658c86 (patch)
tree9057cd7c09d72e3cb5b65a9ad6b14f56e8c888a5 /epg.c
parente79df5ee06ea93fc4fb1cdf4983cefa726dc8d92 (diff)
downloadvdr-2892300d94f4255f33ebf26866d28e1696658c86.tar.gz
vdr-2892300d94f4255f33ebf26866d28e1696658c86.tar.bz2
Improved cSchedule::DropOutdated()
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/epg.c b/epg.c
index 6496db17..5cab8415 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 <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 1.45 2005/12/26 15:10:27 kls Exp $
+ * $Id: epg.c 1.46 2005/12/27 10:26:38 kls Exp $
*/
#include "epg.h"
@@ -742,18 +742,22 @@ void cSchedule::DropOutdated(time_t SegmentStart, time_t SegmentEnd, uchar Table
{
if (SegmentStart > 0 && SegmentEnd > 0) {
for (cEvent *p = events.First(); p; p = events.Next(p)) {
- if (!(p->EndTime() <= SegmentStart || p->StartTime() >= SegmentEnd)) {
- // The event overlaps with the given time segment.
- if (p->TableID() > TableID || p->TableID() == TableID && p->Version() != Version) {
- // The segment overwrites all events from tables with higher ids, and
- // within the same table id all events must have the same version.
- // We can't delete the event right here because a timer might have
- // a pointer to it, so let's set its id and start time to 0 to have it
- // "phased out":
- UnhashEvent(p);
- p->eventID = 0;
- p->startTime = 0;
+ if (p->EndTime() > SegmentStart) {
+ if (p->StartTime() < SegmentEnd) {
+ // The event overlaps with the given time segment.
+ if (p->TableID() > TableID || p->TableID() == TableID && p->Version() != Version) {
+ // The segment overwrites all events from tables with higher ids, and
+ // within the same table id all events must have the same version.
+ // We can't delete the event right here because a timer might have
+ // a pointer to it, so let's set its id and start time to 0 to have it
+ // "phased out":
+ UnhashEvent(p);
+ p->eventID = 0;
+ p->startTime = 0;
+ }
}
+ else
+ break;
}
}
}