From a0f12dbc79d53d6390464e3bb903d5f1d3baa579 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 28 Jan 2006 15:10:27 +0100 Subject: [PATCH] Fixed cTimers::GetNextActiveTimer() so that it won't return an expired timer --- CONTRIBUTORS | 1 + HISTORY | 2 ++ timers.c | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 284e67d4..d248062b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -941,6 +941,7 @@ Rolf Ahrenberg for reporting a crash in the Schedule menu with events that have no title for a patch that was used to implement automatic cursor advance when entering text via the numeric keys + for reporting a problem with expired timers when shutting down via the Power key Ralf Klueber for reporting a bug in cutting a recording if there is only a single editing mark diff --git a/HISTORY b/HISTORY index f2dabc4b..17f9b2cd 100644 --- a/HISTORY +++ b/HISTORY @@ -4255,3 +4255,5 @@ Video Disk Recorder Revision History recent driver/firmware versions. - The epg.data file is now written when VDR exits (suggested by Daniel Karsubka). - There is now a log message when VDR writes the epg.data file. +- Fixed cTimers::GetNextActiveTimer() so that it won't return an expired timer + (reported by Rolf Ahrenberg). diff --git a/timers.c b/timers.c index e5fc8436..ab426802 100644 --- a/timers.c +++ b/timers.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: timers.c 1.44 2006/01/27 15:35:17 kls Exp $ + * $Id: timers.c 1.45 2006/01/28 15:09:05 kls Exp $ */ #include "timers.h" @@ -567,7 +567,7 @@ cTimer *cTimers::GetNextActiveTimer(void) { cTimer *t0 = NULL; for (cTimer *ti = First(); ti; ti = Next(ti)) { - if ((ti->HasFlags(tfActive)) && (!t0 || ti->Compare(*t0) < 0)) + if ((ti->HasFlags(tfActive)) && (!t0 || ti->StopTime() > time(NULL) && ti->Compare(*t0) < 0)) t0 = ti; } return t0;