summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2021-04-20 13:22:37 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2021-04-20 13:22:37 +0200
commitce23ba64bd4c606576a8cd6003c2dfd4f9820ed6 (patch)
treeba94ca208f3efcf699ee5a25020ad0f55d961ec4
parent02c668a6a9c6cbf4fc1638122be53b7155c900e0 (diff)
downloadvdr-ce23ba64bd4c606576a8cd6003c2dfd4f9820ed6.tar.gz
vdr-ce23ba64bd4c606576a8cd6003c2dfd4f9820ed6.tar.bz2
Deleting expired timers is now triggered immediately after the timers are modified
-rw-r--r--HISTORY3
-rw-r--r--timers.c8
-rw-r--r--timers.h4
-rw-r--r--vdr.c4
4 files changed, 11 insertions, 8 deletions
diff --git a/HISTORY b/HISTORY
index 41ea8673..68c29767 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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.
diff --git a/timers.c b/timers.c
index 0cd2bf54..1b6539ae 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.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();
diff --git a/timers.h b/timers.h
index cffd5d09..9d40992f 100644
--- a/timers.h
+++ b/timers.h
@@ -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);
diff --git a/vdr.c b/vdr.c
index 47faf486..7b5cc2f5 100644
--- a/vdr.c
+++ b/vdr.c
@@ -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();