Fixed regenerating the index file of a recording in case it is present, but empty

This commit is contained in:
Klaus Schmidinger 2022-11-28 14:39:23 +01:00
parent 6888ea68b6
commit 4425918d31
3 changed files with 6 additions and 2 deletions

View File

@ -3563,6 +3563,8 @@ Stefan Herdler <herdler@gmx.de>
".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 <tobias.faust@gmx.de>
for the original "jumpingseconds" patch

View File

@ -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).

View File

@ -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