summaryrefslogtreecommitdiff
path: root/timers.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2006-03-26 14:38:46 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2006-03-26 14:38:46 +0200
commit5f7e788ae8bf187760bbc122bac1221d7e62af6a (patch)
tree9596771729425accb3314ecf424e2feec1865597 /timers.c
parente789efcb963aa1db9517dbe4c3652b5186e530ce (diff)
downloadvdr-5f7e788ae8bf187760bbc122bac1221d7e62af6a.tar.gz
vdr-5f7e788ae8bf187760bbc122bac1221d7e62af6a.tar.bz2
Improved deleting expired single shot timers1.3.45
Diffstat (limited to 'timers.c')
-rw-r--r--timers.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/timers.c b/timers.c
index 6190c15a..c7107231 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.54 2006/03/25 12:43:59 kls Exp $
+ * $Id: timers.c 1.55 2006/03/26 14:38:46 kls Exp $
*/
#include "timers.h"
@@ -12,6 +12,7 @@
#include "channels.h"
#include "device.h"
#include "i18n.h"
+#include "libsi/si.h"
#include "remote.h"
// IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d'
@@ -409,7 +410,13 @@ int cTimer::Matches(const cEvent *Event, int *Overlap) const
bool cTimer::Expired(void) const
{
- return IsSingleEvent() && !Recording() && StopTime() + EXPIRELATENCY <= time(NULL);
+ if (IsSingleEvent() && !Recording() && StopTime() + EXPIRELATENCY <= time(NULL)) {
+ if (HasFlags(tfVps) && event && event->Vps())
+ return event->RunningStatus() == SI::RunningStatusNotRunning;
+ else
+ return true;
+ }
+ return false;
}
time_t cTimer::StartTime(void) const
@@ -578,6 +585,7 @@ cTimers::cTimers(void)
state = 0;
beingEdited = 0;;
lastSetEvents = 0;
+ lastDeleteExpired = 0;
}
cTimer *cTimers::GetTimer(cTimer *Timer)
@@ -673,6 +681,8 @@ void cTimers::SetEvents(void)
void cTimers::DeleteExpired(void)
{
+ if (time(NULL) - lastDeleteExpired < 30)
+ return;
cTimer *ti = First();
while (ti) {
cTimer *next = Next(ti);
@@ -683,4 +693,5 @@ void cTimers::DeleteExpired(void)
}
ti = next;
}
+ lastDeleteExpired = time(NULL);
}