diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2021-04-20 13:22:37 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2021-04-20 13:22:37 +0200 |
commit | ce23ba64bd4c606576a8cd6003c2dfd4f9820ed6 (patch) | |
tree | ba94ca208f3efcf699ee5a25020ad0f55d961ec4 | |
parent | 02c668a6a9c6cbf4fc1638122be53b7155c900e0 (diff) | |
download | vdr-ce23ba64bd4c606576a8cd6003c2dfd4f9820ed6.tar.gz vdr-ce23ba64bd4c606576a8cd6003c2dfd4f9820ed6.tar.bz2 |
Deleting expired timers is now triggered immediately after the timers are modified
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | timers.c | 8 | ||||
-rw-r--r-- | timers.h | 4 | ||||
-rw-r--r-- | vdr.c | 4 |
4 files changed, 11 insertions, 8 deletions
@@ -9641,7 +9641,7 @@ Video Disk Recorder Revision History - No longer switching devices for pattern timers (thanks to Helmut Binder). - cTimer::TriggerRespawn() now only acts on local timers. -2021-04-19: +2021-04-20: - 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 @@ -9661,3 +9661,4 @@ Video Disk Recorder Revision History - 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. - EXPIRELATENCY now only applies to VPS timers. +- Deleting expired timers is now triggered immediately after the timers are modified. @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: timers.c 5.15 2021/04/20 09:50:02 kls Exp $ + * $Id: timers.c 5.16 2021/04/20 13:22:37 kls Exp $ */ #include "timers.h" @@ -1238,9 +1238,11 @@ bool cTimers::AdjustSpawnedTimers(void) return TimersModified; } -bool cTimers::DeleteExpired(void) +#define DELETE_EXPIRED_TIMEOUT 30 // seconds + +bool cTimers::DeleteExpired(bool Force) { - if (time(NULL) - lastDeleteExpired < 30) + if (!Force && time(NULL) - lastDeleteExpired < DELETE_EXPIRED_TIMEOUT) return false; bool TimersModified = false; cTimer *ti = First(); @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: timers.h 5.7 2021/04/18 14:56:40 kls Exp $ + * $Id: timers.h 5.8 2021/04/20 13:22:37 kls Exp $ */ #ifndef __TIMERS_H @@ -203,7 +203,7 @@ public: bool SetEvents(const cSchedules *Schedules); bool SpawnPatternTimers(const cSchedules *Schedules); bool AdjustSpawnedTimers(void); - bool DeleteExpired(void); + bool DeleteExpired(bool Force); void Add(cTimer *Timer, cTimer *After = NULL); void Ins(cTimer *Timer, cTimer *Before = NULL); void Del(cTimer *Timer, bool DeleteObject = true); @@ -22,7 +22,7 @@ * * The project's page is at http://www.tvdr.de * - * $Id: vdr.c 5.4 2021/04/10 11:32:50 kls Exp $ + * $Id: vdr.c 5.5 2021/04/20 13:22:37 kls Exp $ */ #include <getopt.h> @@ -1188,7 +1188,7 @@ int main(int argc, char *argv[]) LastTimerCheck = Now; } // Delete expired timers: - if (Timers->DeleteExpired()) + if (Timers->DeleteExpired(TimersModified)) TimersModified = true; // Make sure there is enough free disk space for ongoing recordings: int MaxPriority = Timers->GetMaxPriority(); |