summaryrefslogtreecommitdiff
path: root/recording.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2021-05-23 15:03:17 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2021-05-23 15:03:17 +0200
commit8f52603665c024e1cab46529b34fb75719f5a58e (patch)
treeadc724d913031bc4adf9ee1716200c13e687bece /recording.c
parentc40fb4b4aa1f594fa94d89673d0a537bac3ec91d (diff)
downloadvdr-8f52603665c024e1cab46529b34fb75719f5a58e.tar.gz
vdr-8f52603665c024e1cab46529b34fb75719f5a58e.tar.bz2
cRecordingInfo::Errors() now returns -1 for old recordings; added a missing 'const'
Diffstat (limited to 'recording.c')
-rw-r--r--recording.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/recording.c b/recording.c
index 36a2e483..574e0bdf 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.7 2021/05/19 11:22:20 kls Exp $
+ * $Id: recording.c 5.8 2021/05/23 15:03:17 kls Exp $
*/
#include "recording.h"
@@ -359,7 +359,7 @@ cRecordingInfo::cRecordingInfo(const cChannel *Channel, const cEvent *Event)
priority = MAXPRIORITY;
lifetime = MAXLIFETIME;
fileName = NULL;
- errors = 0;
+ errors = -1;
if (Channel) {
// Since the EPG data's component records can carry only a single
// language code, let's see whether the channel's PID data has
@@ -415,7 +415,7 @@ cRecordingInfo::cRecordingInfo(const char *FileName)
ownEvent = new cEvent(0);
event = ownEvent;
aux = NULL;
- errors = 0;
+ errors = -1;
framesPerSecond = DEFAULTFRAMESPERSECOND;
priority = MAXPRIORITY;
lifetime = MAXLIFETIME;
@@ -1202,7 +1202,9 @@ bool cRecording::WriteInfo(const char *OtherFileName)
// Let's keep the error counter if this is a re-started recording:
cRecordingInfo ExistingInfo(FileName());
if (ExistingInfo.Read())
- info->SetErrors(ExistingInfo.Errors());
+ info->SetErrors(max(0, ExistingInfo.Errors()));
+ else
+ info->SetErrors(0);
}
else {
// This is an edited recording, so let's clear the error counter: