diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2012-11-12 14:51:18 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2012-11-12 14:51:18 +0100 |
commit | bc06fdf4149cc019ee95cbcc150f7627bb7c14b5 (patch) | |
tree | af3e3608e902c25ab705ad1274325790e56907ea | |
parent | b951ca48a5e4bb15c52465485ef48dd0fb537330 (diff) | |
download | vdr-bc06fdf4149cc019ee95cbcc150f7627bb7c14b5.tar.gz vdr-bc06fdf4149cc019ee95cbcc150f7627bb7c14b5.tar.bz2 |
The return type of cMarks::Add() has been changed to void
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | recording.c | 12 | ||||
-rw-r--r-- | recording.h | 5 |
3 files changed, 10 insertions, 10 deletions
@@ -7312,3 +7312,6 @@ Video Disk Recorder Revision History start up to twice as fast as before. - Updated the Romanian OSD texts (thanks to Lucian Muresan). - Fixed handling the very last entry in a recording index. +- The return type of cMarks::Add() has been changed to void, since due to the sorting + of the list of marks the returned pointer might have pointed to a totally different + mark. Besides, the return value was never actually used. diff --git a/recording.c b/recording.c index 2955cb34..79db1c74 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 2.71 2012/11/12 14:48:12 kls Exp $ + * $Id: recording.c 2.72 2012/11/12 14:51:09 kls Exp $ */ #include "recording.h" @@ -1423,14 +1423,10 @@ void cMarks::Sort(void) } } -cMark *cMarks::Add(int Position) +void cMarks::Add(int Position) { - cMark *m = Get(Position); - if (!m) { - cConfig<cMark>::Add(m = new cMark(Position, NULL, framesPerSecond)); - Sort(); - } - return m; + cConfig<cMark>::Add(new cMark(Position, NULL, framesPerSecond)); + Sort(); } cMark *cMarks::Get(int Position) diff --git a/recording.h b/recording.h index 22c5d3a7..7118e783 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 2.38 2012/10/15 10:22:27 kls Exp $ + * $Id: recording.h 2.39 2012/11/12 14:51:09 kls Exp $ */ #ifndef __RECORDING_H @@ -234,7 +234,7 @@ public: bool Update(void); void Align(void); void Sort(void); - cMark *Add(int Position); + void Add(int Position); cMark *Get(int Position); cMark *GetPrev(int Position); cMark *GetNext(int Position); @@ -301,6 +301,7 @@ public: ///< If there is no actual index data available, 0 is returned. int Get(uint16_t FileNumber, off_t FileOffset); int Last(void) { CatchUp(); return last; } + ///< Returns the index of the last entry in this file, or -1 if the file is empty. int GetResume(void) { return resumeFile.Read(); } bool StoreResume(int Index) { return resumeFile.Save(Index); } bool IsStillRecording(void); |