summaryrefslogtreecommitdiff
path: root/timers.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2021-04-20 09:50:02 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2021-04-20 09:50:02 +0200
commit02c668a6a9c6cbf4fc1638122be53b7155c900e0 (patch)
treec3d33dfdb51a99c8eded3ac916dddc1dd5f8b3ef /timers.c
parent9de337d2ee7740b238181ec59056a4baaaa36a63 (diff)
downloadvdr-02c668a6a9c6cbf4fc1638122be53b7155c900e0.tar.gz
vdr-02c668a6a9c6cbf4fc1638122be53b7155c900e0.tar.bz2
EXPIRELATENCY now only applies to VPS timers
Diffstat (limited to 'timers.c')
-rw-r--r--timers.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/timers.c b/timers.c
index fed6d88d..0cd2bf54 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 5.14 2021/04/18 14:56:40 kls Exp $
+ * $Id: timers.c 5.15 2021/04/20 09:50:02 kls Exp $
*/
#include "timers.h"
@@ -693,10 +693,13 @@ eTimerMatch cTimer::Matches(const cEvent *Event, int *Overlap) const
bool cTimer::Expired(void) const
{
- return IsSingleEvent()
- && !Recording()
- && StopTime() + EXPIRELATENCY <= time(NULL)
- && (!HasFlags(tfVps) || !event || !event->Vps() || event->EndTime() + EXPIRELATENCY <= time(NULL));
+ if (IsSingleEvent() && !Recording()) {
+ time_t ExpireTime = StopTimeEvent();
+ if (HasFlags(tfVps))
+ ExpireTime += EXPIRELATENCY;
+ return ExpireTime <= time(NULL);
+ }
+ return false;
}
time_t cTimer::StartTime(void) const
@@ -776,8 +779,10 @@ bool cTimer::SpawnPatternTimers(const cSchedules *Schedules, cTimers *Timers)
// Check all following matching events that would start while the first timer
// is still recording:
bool UseVps = Timer->HasFlags(tfVps);
- time_t Limit = Timer->StopTime() + EXPIRELATENCY;
- if (!UseVps)
+ time_t Limit = Timer->StopTimeEvent();
+ if (UseVps)
+ Limit += EXPIRELATENCY;
+ else
Limit += Setup.MarginStart * 60;
for (e = Schedule->Events()->Next(e); e; e = Schedule->Events()->Next(e)) {
if (e->StartTime() <= Limit) {