mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Deleting expired timers is now triggered immediately after the timers are modified
This commit is contained in:
parent
02c668a6a9
commit
ce23ba64bd
3
HISTORY
3
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.
|
||||
|
8
timers.c
8
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();
|
||||
|
4
timers.h
4
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);
|
||||
|
4
vdr.c
4
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();
|
||||
|
Loading…
Reference in New Issue
Block a user