summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2013-10-12 12:11:21 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2013-10-12 12:11:21 +0200
commitddce16326c50b0622fbdceeef7a07128098e8f85 (patch)
tree1d06dd3da5dcebe89dfa9916522f5ffb96e91b60
parentc8d77e241f91f7f067186819c410d81e3de35223 (diff)
downloadvdr-ddce16326c50b0622fbdceeef7a07128098e8f85.tar.gz
vdr-ddce16326c50b0622fbdceeef7a07128098e8f85.tar.bz2
Changed cRecorder::Action() to use cTimeMs instead of time()
-rw-r--r--CONTRIBUTORS2
-rw-r--r--HISTORY3
-rw-r--r--recorder.c12
3 files changed, 11 insertions, 6 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 55a4be11..e86037d3 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -3011,6 +3011,8 @@ Torsten Lang <info@torstenlang.de>
for reporting a problem with setting the system time from the TDT in case devices
are tuned to the same transponder on different sources, and these broadcast different
time data
+ for reporting a problem with unjustified "video data stream broken" errors in case
+ the system time is changed while a recording is active
Christian Ruppert <idl0r@gentoo.org>
for some improvements to the Makefiles
diff --git a/HISTORY b/HISTORY
index cbdd3323..b2a407de 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7844,3 +7844,6 @@ Video Disk Recorder Revision History
system time from the TDT, which avoids problems in case devices are tuned to the
same transponder on different sources, and these broadcast different time data
(reported by Torsten Lang).
+- Changed cRecorder::Action() to use cTimeMs instead of time() to avoid problems with
+ unjustified "video data stream broken" errors in case the system time is changed
+ while a recording is active (reported by Torsten Lang).
diff --git a/recorder.c b/recorder.c
index a9cc8c95..88c52d9a 100644
--- a/recorder.c
+++ b/recorder.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recorder.c 2.17 2012/09/22 11:53:57 kls Exp $
+ * $Id: recorder.c 2.17.1.1 2013/10/12 12:10:05 kls Exp $
*/
#include "recorder.h"
@@ -14,7 +14,7 @@
// The maximum time we wait before assuming that a recorded video data stream
// is broken:
-#define MAXBROKENTIMEOUT 30 // seconds
+#define MAXBROKENTIMEOUT 30000 // milliseconds
#define MINFREEDISKSPACE (512) // MB
#define DISKCHECKINTERVAL 100 // seconds
@@ -117,7 +117,7 @@ void cRecorder::Receive(uchar *Data, int Length)
void cRecorder::Action(void)
{
- time_t t = time(NULL);
+ cTimeMs t(MAXBROKENTIMEOUT);
bool InfoWritten = false;
bool FirstIframeSeen = false;
while (Running()) {
@@ -160,16 +160,16 @@ void cRecorder::Action(void)
break;
}
fileSize += Count;
- t = time(NULL);
+ t.Set(MAXBROKENTIMEOUT);
}
}
ringBuffer->Del(Count);
}
}
- if (time(NULL) - t > MAXBROKENTIMEOUT) {
+ if (t.TimedOut()) {
esyslog("ERROR: video data stream broken");
ShutdownHandler.RequestEmergencyExit();
- t = time(NULL);
+ t.Set(MAXBROKENTIMEOUT);
}
}
}