From 4242fa7f22fe31e210640971b2bf21232a23807d Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Thu, 23 May 2019 10:00:48 +0200 Subject: [PATCH] Fixed asserting free disk space in case there is no local timer currently recording --- HISTORY | 3 ++- timers.c | 4 ++-- timers.h | 3 ++- vdr.c | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/HISTORY b/HISTORY index cc6ad282..494b3191 100644 --- a/HISTORY +++ b/HISTORY @@ -9348,7 +9348,7 @@ Video Disk Recorder Revision History Senzel). - Official release. -2019-05-20: Version 2.4.1 +2019-05-23: Version 2.4.1 - Fixed handling the tfRecording flag in the SVDRP commands MODT and UPDT (reported by Johann Friedrichs). @@ -9407,3 +9407,4 @@ Video Disk Recorder Revision History - Fixed handling repeat function for keyboards. - Added a workaround for broadcasters who set an event to status "not running" where this is inappropriate; implicitly setting events to "not running" is now also logged. +- Fixed asserting free disk space in case there is no local timer currently recording. diff --git a/timers.c b/timers.c index 8119b858..e4701ffa 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 4.18 2018/03/17 10:07:19 kls Exp $ + * $Id: timers.c 4.19 2019/05/23 09:46:32 kls Exp $ */ #include "timers.h" @@ -819,7 +819,7 @@ const cTimer *cTimers::GetMatch(const cEvent *Event, eTimerMatch *Match) const int cTimers::GetMaxPriority(void) const { - int n = 0; + int n = -1; for (const cTimer *ti = First(); ti; ti = Next(ti)) { if (!ti->Remote() && ti->Recording()) n = max(n, ti->Priority()); diff --git a/timers.h b/timers.h index 93d5a447..ccb64090 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 4.11 2018/02/27 13:57:26 kls Exp $ + * $Id: timers.h 4.12 2019/05/23 09:47:19 kls Exp $ */ #ifndef __TIMERS_H @@ -178,6 +178,7 @@ public: cTimer *GetMatch(const cEvent *Event, eTimerMatch *Match = NULL) { return const_cast(static_cast(this)->GetMatch(Event, Match)); } int GetMaxPriority(void) const; ///< Returns the maximum priority of all local timers that are currently recording. + ///< If there is no local timer currently recording, -1 is returned. const cTimer *GetNextActiveTimer(void) const; const cTimer *UsesChannel(const cChannel *Channel) const; bool SetEvents(const cSchedules *Schedules); diff --git a/vdr.c b/vdr.c index 0ffa1fca..1f2e7ef8 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.tvdr.de * - * $Id: vdr.c 4.29 2019/03/18 11:17:07 kls Exp $ + * $Id: vdr.c 4.30 2019/05/23 09:48:35 kls Exp $ */ #include @@ -1182,7 +1182,9 @@ int main(int argc, char *argv[]) if (Timers->DeleteExpired()) TimersModified = true; // Make sure there is enough free disk space for ongoing recordings: - AssertFreeDiskSpace(Timers->GetMaxPriority()); + int MaxPriority = Timers->GetMaxPriority(); + if (MaxPriority >= 0) + AssertFreeDiskSpace(MaxPriority); TimersStateKey.Remove(TimersModified); } // Recordings: