summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-05-25 12:56:26 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-05-25 12:56:26 +0200
commit0eb11ea3def106d1844c568a3db9c2add23084ca (patch)
treecccde236b94fb313897bbc768791aafa52743f05
parentb92bb866f6b46752cd8bd79817464ebf660a8a16 (diff)
downloadvdr-0eb11ea3def106d1844c568a3db9c2add23084ca.tar.gz
vdr-0eb11ea3def106d1844c568a3db9c2add23084ca.tar.bz2
Checking for duplicate recordings with the same file name and disabling the second timer
-rw-r--r--CONTRIBUTORS3
-rw-r--r--HISTORY2
-rw-r--r--menu.c19
3 files changed, 23 insertions, 1 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 70e1a4f0..78e1dc0d 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -691,3 +691,6 @@ Ralf Klueber <ralf.klueber@vodafone.com>
Hermann Gausterer <mrq1@gmx.net>
for suggesting to switch to the recording channel in case the current channel
becomes unavailable
+
+Peter Bieringer <pb@bieringer.de>
+ for reporting a problem with duplicate recordings with the same file name
diff --git a/HISTORY b/HISTORY
index bb38e56b..258f3679 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2202,3 +2202,5 @@ Video Disk Recorder Revision History
will be used for FTA recordings in case the CAM is connected to a non-primary
device (thanks to Reinhard Walter Buchner for reporting this one).
- The cCiHandler now closes its file handle when it gets destroyed.
+- Checking for duplicate recordings with the same file name and disabling the
+ second timer (thanks to Peter Bieringer for reporting this one).
diff --git a/menu.c b/menu.c
index b46b0055..9bb9d4c7 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.246 2003/05/24 16:35:34 kls Exp $
+ * $Id: menu.c 1.247 2003/05/25 12:47:30 kls Exp $
*/
#include "menu.h"
@@ -2938,6 +2938,23 @@ cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer, bool Pause)
}
cRecording Recording(timer, Title, Subtitle, Summary);
fileName = strdup(Recording.FileName());
+
+ // crude attempt to avoid duplicate recordings:
+ if (cRecordControls::GetRecordControl(fileName)) {
+ isyslog("already recording: '%s'", fileName);
+ if (Timer) {
+ timer->SetPending(false);
+ timer->SetRecording(false);
+ timer->OnOff();
+ }
+ else {
+ Timers.Del(timer);
+ Timers.Save();
+ }
+ timer = NULL;
+ return;
+ }
+
cRecordingUserCommand::InvokeCommand(RUC_BEFORERECORDING, fileName);
const cChannel *ch = timer->Channel();
recorder = new cRecorder(fileName, ch->Ca(), timer->Priority(), ch->Vpid(), ch->Apid1(), ch->Apid2(), ch->Dpid1(), ch->Dpid2());