1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

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 ".sort" file
for reporting faulty memory handling in cString::Append() for reporting faulty memory handling in cString::Append()
for adding failsafe defaults for 'make LCLBLD=1' to the Makefile 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> Tobias Faust <tobias.faust@gmx.de>
for the original "jumpingseconds" patch for the original "jumpingseconds" patch

View File

@ -9811,3 +9811,5 @@ Video Disk Recorder Revision History
or above. or above.
- Added periodic calls to malloc_trim(0) to reduce memory consumption (thanks to - Added periodic calls to malloc_trim(0) to reduce memory consumption (thanks to
Onur Sentürk). 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 * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "recording.h"
@ -2579,7 +2579,7 @@ cIndexFile::cIndexFile(const char *FileName, bool Record, bool IsPesRecording, b
cCondWait::SleepMs(INDEXFILETESTINTERVAL); cCondWait::SleepMs(INDEXFILETESTINTERVAL);
} }
int delta = 0; 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: // Index file doesn't exist, so try to regenerate it:
if (!isPesRecording) { // sorry, can only do this for TS recordings if (!isPesRecording) { // sorry, can only do this for TS recordings
resumeFile.Delete(); // just in case resumeFile.Delete(); // just in case