mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Added a 15 second grace period before actually stopping a VPS timer
This commit is contained in:
parent
561be36958
commit
824c495d33
@ -2564,6 +2564,7 @@ Markus Ehrnsperger <markus.ehrnsperger@googlemail.com>
|
|||||||
for removing syslog calls in child process after fork()
|
for removing syslog calls in child process after fork()
|
||||||
for adding the move constructor to cString for better performance
|
for adding the move constructor to cString for better performance
|
||||||
for fixing handling primary device on headless systems
|
for fixing handling primary device on headless systems
|
||||||
|
for adding a 15 second grace period before actually stopping a VPS timer
|
||||||
|
|
||||||
Werner Färber <w.faerber@gmx.de>
|
Werner Färber <w.faerber@gmx.de>
|
||||||
for reporting a bug in handling the cPluginManager::Active() result when pressing
|
for reporting a bug in handling the cPluginManager::Active() result when pressing
|
||||||
|
4
HISTORY
4
HISTORY
@ -9887,7 +9887,7 @@ Video Disk Recorder Revision History
|
|||||||
- Fixed possible duplicate component entries in the info of an ongoing recording
|
- Fixed possible duplicate component entries in the info of an ongoing recording
|
||||||
(reported by Christoph Haubrich).
|
(reported by Christoph Haubrich).
|
||||||
|
|
||||||
2024-03-02:
|
2024-03-03:
|
||||||
|
|
||||||
- Fixed the move assignment operator to check for self-assignment (suggested by
|
- Fixed the move assignment operator to check for self-assignment (suggested by
|
||||||
Stefan Herdler).
|
Stefan Herdler).
|
||||||
@ -9896,3 +9896,5 @@ Video Disk Recorder Revision History
|
|||||||
Stefan Herdler).
|
Stefan Herdler).
|
||||||
- Adapted "Setup/Miscellaneous/Show channel names with source" to the new handling
|
- Adapted "Setup/Miscellaneous/Show channel names with source" to the new handling
|
||||||
in cChannel.
|
in cChannel.
|
||||||
|
- Added a 15 second grace period before actually stopping a VPS timer (thanks to
|
||||||
|
Markus Ehrnsperger).
|
||||||
|
19
timers.c
19
timers.c
@ -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.18 2022/11/20 10:57:31 kls Exp $
|
* $Id: timers.c 5.19 2024/03/03 15:47:09 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
@ -21,6 +21,8 @@
|
|||||||
// format characters in order to allow any number of blanks after a numeric
|
// format characters in order to allow any number of blanks after a numeric
|
||||||
// value!
|
// value!
|
||||||
|
|
||||||
|
#define VPSGRACE 15 // seconds we still record after the running status of a VPS event has changed to "not running"
|
||||||
|
|
||||||
// --- cTimer ----------------------------------------------------------------
|
// --- cTimer ----------------------------------------------------------------
|
||||||
|
|
||||||
cTimer::cTimer(bool Instant, bool Pause, const cChannel *Channel)
|
cTimer::cTimer(bool Instant, bool Pause, const cChannel *Channel)
|
||||||
@ -47,6 +49,7 @@ cTimer::cTimer(bool Instant, bool Pause, const cChannel *Channel)
|
|||||||
weekdays = 0;
|
weekdays = 0;
|
||||||
start = now->tm_hour * 100 + now->tm_min;
|
start = now->tm_hour * 100 + now->tm_min;
|
||||||
stop = 0;
|
stop = 0;
|
||||||
|
vpsNotRunning = 0;
|
||||||
if (!Setup.InstantRecordTime && channel && (Instant || Pause)) {
|
if (!Setup.InstantRecordTime && channel && (Instant || Pause)) {
|
||||||
LOCK_SCHEDULES_READ;
|
LOCK_SCHEDULES_READ;
|
||||||
if (const cSchedule *Schedule = Schedules->GetSchedule(channel)) {
|
if (const cSchedule *Schedule = Schedules->GetSchedule(channel)) {
|
||||||
@ -186,6 +189,7 @@ cTimer::cTimer(const cEvent *Event, const char *FileName, const cTimer *PatternT
|
|||||||
aux = NULL;
|
aux = NULL;
|
||||||
remote = NULL;
|
remote = NULL;
|
||||||
event = NULL;
|
event = NULL;
|
||||||
|
vpsNotRunning = 0;
|
||||||
if (!PatternTimer || PatternTimer->HasFlags(tfVps)) {
|
if (!PatternTimer || PatternTimer->HasFlags(tfVps)) {
|
||||||
if (Event->Vps() && (PatternTimer || Setup.UseVps))
|
if (Event->Vps() && (PatternTimer || Setup.UseVps))
|
||||||
SetFlags(tfVps);
|
SetFlags(tfVps);
|
||||||
@ -255,6 +259,7 @@ cTimer& cTimer::operator= (const cTimer &Timer)
|
|||||||
stop = Timer.stop;
|
stop = Timer.stop;
|
||||||
priority = Timer.priority;
|
priority = Timer.priority;
|
||||||
lifetime = Timer.lifetime;
|
lifetime = Timer.lifetime;
|
||||||
|
vpsNotRunning = 0;
|
||||||
strncpy(pattern, Timer.pattern, sizeof(pattern));
|
strncpy(pattern, Timer.pattern, sizeof(pattern));
|
||||||
strncpy(file, Timer.file, sizeof(file));
|
strncpy(file, Timer.file, sizeof(file));
|
||||||
free(aux);
|
free(aux);
|
||||||
@ -611,8 +616,16 @@ bool cTimer::Matches(time_t t, bool Directly, int Margin) const
|
|||||||
startTime = event->StartTime();
|
startTime = event->StartTime();
|
||||||
stopTime = event->EndTime();
|
stopTime = event->EndTime();
|
||||||
if (!Margin) { // this is an actual check
|
if (!Margin) { // this is an actual check
|
||||||
if (event->Schedule()->PresentSeenWithin(EITPRESENTFOLLOWINGRATE)) // VPS control can only work with up-to-date events...
|
if (event->Schedule()->PresentSeenWithin(EITPRESENTFOLLOWINGRATE)) { // VPS control can only work with up-to-date events...
|
||||||
return event->IsRunning(true);
|
bool running = event->IsRunning(true);
|
||||||
|
if (!running) {
|
||||||
|
if (Recording() && vpsNotRunning == 0)
|
||||||
|
vpsNotRunning = time(NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
vpsNotRunning = 0;
|
||||||
|
return running || time(NULL) < vpsNotRunning + VPSGRACE;
|
||||||
|
}
|
||||||
// ...otherwise we fall back to normal timer handling below (note: Margin == 0!)
|
// ...otherwise we fall back to normal timer handling below (note: Margin == 0!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
3
timers.h
3
timers.h
@ -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.h 5.9 2022/11/20 10:57:31 kls Exp $
|
* $Id: timers.h 5.10 2024/03/03 15:47:09 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __TIMERS_H
|
#ifndef __TIMERS_H
|
||||||
@ -37,6 +37,7 @@ private:
|
|||||||
int scheduleStateSpawn;
|
int scheduleStateSpawn;
|
||||||
int scheduleStateAdjust;
|
int scheduleStateAdjust;
|
||||||
mutable time_t deferred; ///< Matches(time_t, ...) will return false if the current time is before this value
|
mutable time_t deferred; ///< Matches(time_t, ...) will return false if the current time is before this value
|
||||||
|
mutable time_t vpsNotRunning; ///< the time when a VPS event's running status changed to "not running"
|
||||||
bool pending, inVpsMargin;
|
bool pending, inVpsMargin;
|
||||||
uint flags;
|
uint flags;
|
||||||
const cChannel *channel;
|
const cChannel *channel;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user