From 71d53f2c638f6afaa392ae8fe18ced0e9bebb8e5 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Thu, 26 Apr 2012 10:48:18 +0200 Subject: [PATCH] Fixed the SVDRP command UPDR, which didn't update the global recordings list --- CONTRIBUTORS | 1 + HISTORY | 2 ++ svdrp.c | 28 ++++++++++++++-------------- svdrp.h | 4 ++-- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 9bdbfc6a..248d14b6 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2723,6 +2723,7 @@ Lars Hanisch for suggesting to assign the source character 'V' to "Analog Video" for a patch that was used to implement SCR (Satellite Channel Routing) for implementing the SVDRP command 'UPDR' + for reporting that the SVDRP command UPDR didn't update the global recordings list Alex Lasnier for adding tuning support for ATSC devices diff --git a/HISTORY b/HISTORY index 63c9041b..a05cf5e3 100644 --- a/HISTORY +++ b/HISTORY @@ -7087,3 +7087,5 @@ Video Disk Recorder Revision History - The Timers list is now marked as modified whenever a recording starts or ends. - Fixed cDevice::StillPicture(), making sure it doesn't call the derived class's function if no buffer has been allocated. +- Fixed the SVDRP command UPDR, which didn't update the global recordings list + (reported by Lars Hanisch). diff --git a/svdrp.c b/svdrp.c index 01366ddf..7884ec58 100644 --- a/svdrp.c +++ b/svdrp.c @@ -10,7 +10,7 @@ * and interact with the Video Disk Recorder - or write a full featured * graphical interface that sits on top of an SVDRP connection. * - * $Id: svdrp.c 2.16 2012/03/04 12:05:56 kls Exp $ + * $Id: svdrp.c 2.17 2012/04/26 10:36:11 kls Exp $ */ #include "svdrp.h" @@ -662,14 +662,14 @@ void cSVDRP::CmdDELR(const char *Option) { if (*Option) { if (isnumber(Option)) { - cRecording *recording = Recordings.Get(strtol(Option, NULL, 10) - 1); + cRecording *recording = recordings.Get(strtol(Option, NULL, 10) - 1); if (recording) { cRecordControl *rc = cRecordControls::GetRecordControl(recording->FileName()); if (!rc) { if (!cCutter::Active(recording->FileName())) { if (recording->Delete()) { Reply(250, "Recording \"%s\" deleted", Option); - ::Recordings.DelByName(recording->FileName()); + Recordings.DelByName(recording->FileName()); } else Reply(554, "Error while deleting recording!"); @@ -681,7 +681,7 @@ void cSVDRP::CmdDELR(const char *Option) Reply(550, "Recording \"%s\" is in use by timer %d", Option, rc->Timer()->Index() + 1); } else - Reply(550, "Recording \"%s\" not found%s", Option, Recordings.Count() ? "" : " (use LSTR before deleting)"); + Reply(550, "Recording \"%s\" not found%s", Option, recordings.Count() ? "" : " (use LSTR before deleting)"); } else Reply(501, "Error in recording number \"%s\"", Option); @@ -723,7 +723,7 @@ void cSVDRP::CmdEDIT(const char *Option) { if (*Option) { if (isnumber(Option)) { - cRecording *recording = Recordings.Get(strtol(Option, NULL, 10) - 1); + cRecording *recording = recordings.Get(strtol(Option, NULL, 10) - 1); if (recording) { cMarks Marks; if (Marks.Load(recording->FileName(), recording->FramesPerSecond(), recording->IsPesRecording()) && Marks.Count()) { @@ -740,7 +740,7 @@ void cSVDRP::CmdEDIT(const char *Option) Reply(554, "No editing marks defined"); } else - Reply(550, "Recording \"%s\" not found%s", Option, Recordings.Count() ? "" : " (use LSTR before editing)"); + Reply(550, "Recording \"%s\" not found%s", Option, recordings.Count() ? "" : " (use LSTR before editing)"); } else Reply(501, "Error in recording number \"%s\"", Option); @@ -1076,10 +1076,10 @@ void cSVDRP::CmdLSTE(const char *Option) void cSVDRP::CmdLSTR(const char *Option) { - bool recordings = Recordings.Update(true); + recordings.Update(true); if (*Option) { if (isnumber(Option)) { - cRecording *recording = Recordings.Get(strtol(Option, NULL, 10) - 1); + cRecording *recording = recordings.Get(strtol(Option, NULL, 10) - 1); if (recording) { FILE *f = fdopen(file, "w"); if (f) { @@ -1097,11 +1097,11 @@ void cSVDRP::CmdLSTR(const char *Option) else Reply(501, "Error in recording number \"%s\"", Option); } - else if (recordings) { - cRecording *recording = Recordings.First(); + else if (recordings.Count()) { + cRecording *recording = recordings.First(); while (recording) { - Reply(recording == Recordings.Last() ? 250 : -250, "%d %s", recording->Index() + 1, recording->Title(' ', true)); - recording = Recordings.Next(recording); + Reply(recording == recordings.Last() ? 250 : -250, "%d %s", recording->Index() + 1, recording->Title(' ', true)); + recording = recordings.Next(recording); } } else @@ -1367,7 +1367,7 @@ void cSVDRP::CmdPLAY(const char *Option) char c = *option; *option = 0; if (isnumber(num)) { - cRecording *recording = Recordings.Get(strtol(num, NULL, 10) - 1); + cRecording *recording = recordings.Get(strtol(num, NULL, 10) - 1); if (recording) { if (c) option = skipspace(++option); @@ -1389,7 +1389,7 @@ void cSVDRP::CmdPLAY(const char *Option) Reply(250, "Playing recording \"%s\" [%s]", num, recording->Title()); } else - Reply(550, "Recording \"%s\" not found%s", num, Recordings.Count() ? "" : " (use LSTR before playing)"); + Reply(550, "Recording \"%s\" not found%s", num, recordings.Count() ? "" : " (use LSTR before playing)"); } else Reply(501, "Error in recording number \"%s\"", num); diff --git a/svdrp.h b/svdrp.h index 8ba096c8..5ec9bc76 100644 --- a/svdrp.h +++ b/svdrp.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: svdrp.h 2.2 2012/02/16 12:37:53 kls Exp $ + * $Id: svdrp.h 2.3 2012/04/26 10:30:06 kls Exp $ */ #ifndef __SVDRP_H @@ -43,7 +43,7 @@ class cSVDRP { private: cSocket socket; cFile file; - cRecordings Recordings; + cRecordings recordings; cPUTEhandler *PUTEhandler; int numChars; int length;