diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2021-05-23 15:03:17 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2021-05-23 15:03:17 +0200 |
commit | 8f52603665c024e1cab46529b34fb75719f5a58e (patch) | |
tree | adc724d913031bc4adf9ee1716200c13e687bece | |
parent | c40fb4b4aa1f594fa94d89673d0a537bac3ec91d (diff) | |
download | vdr-8f52603665c024e1cab46529b34fb75719f5a58e.tar.gz vdr-8f52603665c024e1cab46529b34fb75719f5a58e.tar.bz2 |
cRecordingInfo::Errors() now returns -1 for old recordings; added a missing 'const'
-rw-r--r-- | CONTRIBUTORS | 2 | ||||
-rw-r--r-- | HISTORY | 5 | ||||
-rw-r--r-- | recorder.c | 4 | ||||
-rw-r--r-- | recording.c | 10 | ||||
-rw-r--r-- | recording.h | 4 |
5 files changed, 17 insertions, 8 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 4efd3f4f..ef7ddf5f 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2449,6 +2449,8 @@ Christoph Haubrich <christoph1.haubrich@arcor.de> for reporting an unnecessary double call to Display() in cMenuRecording::RefreshRecording() for reporting too much memory being allocated in the cImage constructors 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' Pekka Mauno <pekka.mauno@iki.fi> for fixing cSchedule::GetFollowingEvent() in case there is currently no present @@ -9705,3 +9705,8 @@ Video Disk Recorder Revision History no longer available. You can add 'DEPRECATED_SKIN_SETITEMEVENT=1' when compiling in order to restore this functionality. However, it is recommended to use the function with the TimerActive parameter instead. + +2021-05-23: + +- cRecordingInfo::Errors() now returns -1 for old recordings; added a missing 'const' + (suggested by Christoph Haubrich). @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recorder.c 5.1 2021/05/19 11:22:20 kls Exp $ + * $Id: recorder.c 5.2 2021/05/23 15:03:17 kls Exp $ */ #include "recorder.h" @@ -170,7 +170,7 @@ cRecorder::cRecorder(const char *FileName, const cChannel *Channel, int Priority recordingName = strdup(FileName); recordingInfo = new cRecordingInfo(recordingName); recordingInfo->Read(); - oldErrors = recordingInfo->Errors(); // in case this is a re-started recording + oldErrors = max(0, recordingInfo->Errors()); // in case this is a re-started recording errors = oldErrors; firstIframeSeen = false; 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: diff --git a/recording.h b/recording.h index 34f097fa..4d7d8a6c 100644 --- a/recording.h +++ b/recording.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.h 5.4 2021/05/19 11:22:20 kls Exp $ + * $Id: recording.h 5.5 2021/05/23 15:03:17 kls Exp $ */ #ifndef __RECORDING_H @@ -89,7 +89,7 @@ public: double FramesPerSecond(void) const { return framesPerSecond; } void SetFramesPerSecond(double FramesPerSecond); void SetFileName(const char *FileName); - int Errors(void) { return errors; } + int Errors(void) const { return errors; } // returns -1 if undefined void SetErrors(int Errors); bool Write(FILE *f, const char *Prefix = "") const; bool Read(void); |