mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-12-26 23:06:44 +01:00
Added cTimer::VpsTime()
This commit is contained in:
@@ -2604,6 +2604,7 @@ Markus Ehrnsperger <markus.ehrnsperger@googlemail.com>
|
||||
for reporting that cTimer::StartTime() may return different values, depending on the
|
||||
parameters of a previous call to cTimer::Matches()
|
||||
for fixing the stop time of repeating timers in case of DST change
|
||||
for suggesting to add cTimer::VpsTime()
|
||||
|
||||
Werner Färber <w.faerber@gmx.de>
|
||||
for reporting a bug in handling the cPluginManager::Active() result when pressing
|
||||
|
||||
3
HISTORY
3
HISTORY
@@ -10138,7 +10138,7 @@ Video Disk Recorder Revision History
|
||||
- Fixed an invalid lock sequence when pressing the Channel+/Channel- keys while in the
|
||||
"What's on..." menu in live view.
|
||||
|
||||
2025-07-09:
|
||||
2025-07-10:
|
||||
|
||||
- Fixed cPoller::Poll() to allow negative timeout values again.
|
||||
- When regenerating the index of a recording, PID changes are now taken into account
|
||||
@@ -10168,3 +10168,4 @@ Video Disk Recorder Revision History
|
||||
- Fixed expiring VPS timers in case the event has not yet startet after its announced end time.
|
||||
- Reverted the change in cCondWait::SleepMs() because of a possible lockup (reported by Johann
|
||||
Friedrichs).
|
||||
- Added cTimer::VpsTime() (suggested by Markus Ehrnsperger).
|
||||
|
||||
14
timers.c
14
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.28 2025/07/09 14:49:59 kls Exp $
|
||||
* $Id: timers.c 5.29 2025/07/10 19:12:24 kls Exp $
|
||||
*/
|
||||
|
||||
#include "timers.h"
|
||||
@@ -608,6 +608,13 @@ void cTimer::CalcStartStopTime(time_t &startTime, time_t &stopTime, time_t t) co
|
||||
}
|
||||
}
|
||||
|
||||
time_t cTimer::VpsTime(time_t t) const
|
||||
{
|
||||
time_t startTime, stopTime;
|
||||
CalcStartStopTime(startTime, stopTime, t);
|
||||
return startTime;
|
||||
}
|
||||
|
||||
#if DEPRECATED_TIMER_MATCHES
|
||||
bool cTimer::Matches(time_t t, bool Directly) const
|
||||
{
|
||||
@@ -797,8 +804,9 @@ bool cTimer::Expired(void) const
|
||||
}
|
||||
if (FirstEvent) {
|
||||
if (Schedule) {
|
||||
time_t Vps = VpsTime();
|
||||
for (const cEvent *e = FirstEvent; e; e = Schedule->Events()->Next(e)) {
|
||||
if (e->Vps() == StartTime()) {
|
||||
if (e->Vps() == Vps) {
|
||||
ExpireTime = e->EndTime() + EXPIRELATENCY;
|
||||
dsyslog("timer %s is waiting for next VPS event %s", *ToDescr(), *e->ToDescr());
|
||||
// no break here - let's play it safe and look at *all* events
|
||||
@@ -1132,7 +1140,7 @@ bool cTimer::HasFlags(uint Flags) const
|
||||
void cTimer::Skip(void)
|
||||
{
|
||||
cMutexLock MutexLock(&mutex);
|
||||
day = IncDay(SetTime(StartTime(), 0), 1);
|
||||
day = IncDay(SetTime(VpsTime(), 0), 1);
|
||||
startTime = 0;
|
||||
SetEvent(NULL);
|
||||
}
|
||||
|
||||
5
timers.h
5
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.13 2025/07/06 15:06:55 kls Exp $
|
||||
* $Id: timers.h 5.14 2025/07/10 19:12:24 kls Exp $
|
||||
*/
|
||||
|
||||
#ifndef __TIMERS_H
|
||||
@@ -100,6 +100,9 @@ public:
|
||||
///< Calculates the raw start and stop time of this timer, as given by the user in the timer definition.
|
||||
///< If t is given, and this is a repeating timer, the start and stop times on that day are returned
|
||||
///< (default is "today"). t can be any time_t value on the given day.
|
||||
time_t VpsTime(time_t t = 0) const;
|
||||
///< Returns the VPS time of this timer. This is a shortcut for calling CalcStartStopTime() and using the
|
||||
///< result given in the startTime parameter. The parameter t is handed to CalcStartStopTime().
|
||||
#define DEPRECATED_TIMER_MATCHES 1
|
||||
#if DEPRECATED_TIMER_MATCHES
|
||||
// for backwards compatibility, remove these functions once Matches(time_t ...) has default parameters:
|
||||
|
||||
Reference in New Issue
Block a user