From 6c5a448dec029f4d72629662cb2d1869dfec3f35 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 21 Jun 2021 15:30:16 +0200 Subject: [PATCH] Fixed deleting the edited recording in case of an error --- CONTRIBUTORS | 1 + HISTORY | 3 ++- recording.c | 11 +++++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index c12dca67..b1a1f828 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2452,6 +2452,7 @@ Christoph Haubrich for making the 'Edit path' dialog also show the total size of all recordings in that path for suggesting to make cRecordingInfo::Errors() return -1 for old recordings, and reporting a missing 'const' + for reporting that the edited recording is not deleted in case of an error Pekka Mauno for fixing cSchedule::GetFollowingEvent() in case there is currently no present diff --git a/HISTORY b/HISTORY index 54a61916..b20b400f 100644 --- a/HISTORY +++ b/HISTORY @@ -9720,7 +9720,7 @@ Video Disk Recorder Revision History - Removed unused declaration of cDvbTuner::SetFrontendType() (thanks to Helmut Binder). - Fixed handling incomplete multi-packet CAT (thanks to Helmut Binder). -2021-06-20: +2021-06-21: - Fixed restarting PMT pids after starting a recording on the currently viewed channel (with help from Helmut Binder). @@ -9732,3 +9732,4 @@ Video Disk Recorder Revision History - When checking whether a recording has already been made, recording names are now compared case insensitive. - Improved responsiveness in cSectionHandler::Action() (thanks to Helmut Binder). +- Fixed deleting the edited recording in case of an error (reported by Christoph Haubrich). diff --git a/recording.c b/recording.c index 24cc175c..f9ff14b1 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 5.11 2021/06/20 10:03:28 kls Exp $ + * $Id: recording.c 5.12 2021/06/21 15:30:16 kls Exp $ */ #include "recording.h" @@ -1968,9 +1968,12 @@ bool cRecordingsHandlerEntry::Active(cRecordings *Recordings) void cRecordingsHandlerEntry::Cleanup(cRecordings *Recordings) { if ((usage & ruCut)) { // this was a cut operation... - if (cutter) { // ...which had not yet ended - delete cutter; - cutter = NULL; + if (cutter // ...which had not yet ended... + || error) { // ...or finished with error + if (cutter) { + delete cutter; + cutter = NULL; + } cVideoDirectory::RemoveVideoFile(fileNameDst); Recordings->DelByName(fileNameDst); }