From 4425918d31fbbb40e23716a7741127e3ecb9489e Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 28 Nov 2022 14:39:23 +0100 Subject: [PATCH] Fixed regenerating the index file of a recording in case it is present, but empty --- CONTRIBUTORS | 2 ++ HISTORY | 2 ++ recording.c | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 85e50f61..355541b4 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3563,6 +3563,8 @@ Stefan Herdler ".sort" file for reporting faulty memory handling in cString::Append() for adding failsafe defaults for 'make LCLBLD=1' to the Makefile + for reporting the index file of a recording not being regenerated in case it is + present, but empty Tobias Faust for the original "jumpingseconds" patch diff --git a/HISTORY b/HISTORY index f366f14e..5eda9b9a 100644 --- a/HISTORY +++ b/HISTORY @@ -9811,3 +9811,5 @@ Video Disk Recorder Revision History or above. - Added periodic calls to malloc_trim(0) to reduce memory consumption (thanks to Onur Sentürk). +- Fixed regenerating the index file of a recording in case it is present, but empty + (reported by Stefan Herdler). diff --git a/recording.c b/recording.c index be9ce548..43b0c269 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.18 2022/11/22 14:33:48 kls Exp $ + * $Id: recording.c 5.19 2022/11/28 14:39:23 kls Exp $ */ #include "recording.h" @@ -2579,7 +2579,7 @@ cIndexFile::cIndexFile(const char *FileName, bool Record, bool IsPesRecording, b cCondWait::SleepMs(INDEXFILETESTINTERVAL); } int delta = 0; - if (!Record && access(fileName, R_OK) != 0) { + if (!Record && (access(fileName, R_OK) != 0 || FileSize(fileName) == 0)) { // Index file doesn't exist, so try to regenerate it: if (!isPesRecording) { // sorry, can only do this for TS recordings resumeFile.Delete(); // just in case