EXPIRELATENCY now only applies to VPS timers

This commit is contained in:
Klaus Schmidinger 2021-04-20 09:50:02 +02:00
parent 9de337d2ee
commit 02c668a6a9
2 changed files with 14 additions and 8 deletions

View File

@ -9641,7 +9641,7 @@ Video Disk Recorder Revision History
- No longer switching devices for pattern timers (thanks to Helmut Binder). - No longer switching devices for pattern timers (thanks to Helmut Binder).
- cTimer::TriggerRespawn() now only acts on local timers. - cTimer::TriggerRespawn() now only acts on local timers.
2021-04-18: 2021-04-19:
- When spawning pattern timers, the new function cTimers::GetTimerForEvent() is now used - When spawning pattern timers, the new function cTimers::GetTimerForEvent() is now used
to check whether a matching event already has a local spawned timer. Reason: creating a timer to check whether a matching event already has a local spawned timer. Reason: creating a timer
@ -9660,3 +9660,4 @@ Video Disk Recorder Revision History
timer is still recording. timer is still recording.
- The new functions cTimer::Start/StopTimeEvent() are now used in the LCARS skin to display - The new functions cTimer::Start/StopTimeEvent() are now used in the LCARS skin to display
the start/stop times of timers in the main menu. the start/stop times of timers in the main menu.
- EXPIRELATENCY now only applies to VPS timers.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "timers.h"
@ -693,10 +693,13 @@ eTimerMatch cTimer::Matches(const cEvent *Event, int *Overlap) const
bool cTimer::Expired(void) const bool cTimer::Expired(void) const
{ {
return IsSingleEvent() if (IsSingleEvent() && !Recording()) {
&& !Recording() time_t ExpireTime = StopTimeEvent();
&& StopTime() + EXPIRELATENCY <= time(NULL) if (HasFlags(tfVps))
&& (!HasFlags(tfVps) || !event || !event->Vps() || event->EndTime() + EXPIRELATENCY <= time(NULL)); ExpireTime += EXPIRELATENCY;
return ExpireTime <= time(NULL);
}
return false;
} }
time_t cTimer::StartTime(void) const 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 // Check all following matching events that would start while the first timer
// is still recording: // is still recording:
bool UseVps = Timer->HasFlags(tfVps); bool UseVps = Timer->HasFlags(tfVps);
time_t Limit = Timer->StopTime() + EXPIRELATENCY; time_t Limit = Timer->StopTimeEvent();
if (!UseVps) if (UseVps)
Limit += EXPIRELATENCY;
else
Limit += Setup.MarginStart * 60; Limit += Setup.MarginStart * 60;
for (e = Schedule->Events()->Next(e); e; e = Schedule->Events()->Next(e)) { for (e = Schedule->Events()->Next(e); e; e = Schedule->Events()->Next(e)) {
if (e->StartTime() <= Limit) { if (e->StartTime() <= Limit) {