Fixed accessing a timer's event schedule in case the event has been removed from the schedule

This commit is contained in:
Klaus Schmidinger 2025-01-07 10:46:22 +01:00
parent 0f80fc5e86
commit 7ab94c7bcb
2 changed files with 7 additions and 4 deletions

View File

@ -10034,7 +10034,7 @@ Video Disk Recorder Revision History
(suggested by Stefan Hofmann). (suggested by Stefan Hofmann).
- Added vdrrootdir and incdir to vdr.pc (thanks to Stefan Hofmann). - Added vdrrootdir and incdir to vdr.pc (thanks to Stefan Hofmann).
2024-12-05: 2025-01-07:
- Removed all DEPRECATED_* code. - Removed all DEPRECATED_* code.
- Fixed error checking in case the fps value can't be determined by the frame parser. - Fixed error checking in case the fps value can't be determined by the frame parser.
@ -10045,3 +10045,5 @@ Video Disk Recorder Revision History
- Added some missing locking. - Added some missing locking.
- TS packets with errors are now skipped when parsing for frames. - TS packets with errors are now skipped when parsing for frames.
- Fixed handling the fps value if it can't be determined from the video data. - Fixed handling the fps value if it can't be determined from the video data.
- Fixed accessing a timer's event schedule in case the event has been removed from the
schedule.

View File

@ -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.21 2024/10/11 13:58:11 kls Exp $ * $Id: timers.c 5.22 2025/01/07 10:46:22 kls Exp $
*/ */
#include "timers.h" #include "timers.h"
@ -620,7 +620,8 @@ 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... const cSchedule *Schedule = event->Schedule();
if (Schedule && Schedule->PresentSeenWithin(EITPRESENTFOLLOWINGRATE)) { // VPS control can only work with up-to-date events...
if (!vpsActive) { if (!vpsActive) {
vpsActive = true; vpsActive = true;
if (Recording()) if (Recording())
@ -636,7 +637,7 @@ bool cTimer::Matches(time_t t, bool Directly, int Margin) const
return running || time(NULL) < vpsNotRunning + VPSGRACE; return running || time(NULL) < vpsNotRunning + VPSGRACE;
} }
if (Recording()) { if (Recording()) {
if (event->Schedule()->PresentSeenWithin(EITPRESENTFOLLOWINGGRACE)) if (Schedule && Schedule->PresentSeenWithin(EITPRESENTFOLLOWINGGRACE))
return event->IsRunning(true); // give it a chance to recover - worst case: the recording will be 60 seconds too long return event->IsRunning(true); // give it a chance to recover - worst case: the recording will be 60 seconds too long
if (vpsActive) { if (vpsActive) {
vpsActive = false; vpsActive = false;