diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 2f6e219e..8c531f00 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -575,6 +575,8 @@ Jan Ekholm Marcel Wiesweg for pointing out a problem with high CPU load during replay for reporting broken support for raw OSDs of plugins + for reporting a problem with cReceivers that want to receive from PIDs that are + currently not transmitting Torsten Herz for fixing a possible deadlock when using the "Blue" button in the "Schedules" menu diff --git a/HISTORY b/HISTORY index 96f1e6fe..64c69793 100644 --- a/HISTORY +++ b/HISTORY @@ -2159,3 +2159,7 @@ Video Disk Recorder Revision History the translators to have their texts translated. Note that there are now 16 different OSD languages, so please make sure you have 16 versions for each of your texts. +- Moved the detection of a broken video data stream from the cDevice into the + cRecorder to avoid problems with cReceivers that want to receive from PIDs + that are currently not transmitting (thanks to Marcel Wiesweg for reporting + this one). diff --git a/device.c b/device.c index b248114a..7562a328 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 1.42 2003/05/11 08:53:09 kls Exp $ + * $Id: device.c 1.43 2003/05/16 13:26:43 kls Exp $ */ #include "device.h" @@ -25,10 +25,6 @@ // The default priority for non-primary devices: #define DEFAULTPRIORITY -2 -// The maximum time we wait before assuming that a recorded video data stream -// is broken: -#define MAXBROKENTIMEOUT 30 // seconds - int cDevice::numDevices = 0; int cDevice::useDevice = 0; int cDevice::nextCardIndex = 0; @@ -656,7 +652,6 @@ void cDevice::Action(void) dsyslog("receiver thread started on device %d (pid=%d)", CardIndex() + 1, getpid()); if (OpenDvr()) { - time_t t = time(NULL); active = true; for (; active;) { // Read data from the DVR device: @@ -671,18 +666,10 @@ void cDevice::Action(void) receiver[i]->Receive(b, TS_SIZE); } Unlock(); - t = time(NULL); } } else break; - - //XXX+ put this into the recorder??? or give the receiver a flag whether it wants this? - if (time(NULL) - t > MAXBROKENTIMEOUT) { - esyslog("ERROR: video data stream broken on device %d", CardIndex() + 1); - cThread::EmergencyExit(true); - t = time(NULL); - } } CloseDvr(); } diff --git a/recorder.c b/recorder.c index 15e86463..d7cc9c31 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 1.5 2003/01/25 16:23:36 kls Exp $ + * $Id: recorder.c 1.6 2003/05/16 13:33:04 kls Exp $ */ #include @@ -16,6 +16,10 @@ // (must be larger than MINVIDEODATA - see remux.h) #define VIDEOBUFSIZE MEGABYTE(5) +// The maximum time we wait before assuming that a recorded video data stream +// is broken: +#define MAXBROKENTIMEOUT 30 // seconds + #define MINFREEDISKSPACE (512) // MB #define DISKCHECKINTERVAL 100 // seconds @@ -110,6 +114,7 @@ void cRecorder::Action(void) { dsyslog("recording thread started (pid=%d)", getpid()); + time_t t = time(NULL); active = true; while (active) { int r; @@ -134,6 +139,12 @@ void cRecorder::Action(void) else break; } + t = time(NULL); + } + else if (time(NULL) - t > MAXBROKENTIMEOUT) { + esyslog("ERROR: video data stream broken"); + cThread::EmergencyExit(true); + t = time(NULL); } else usleep(1); // this keeps the CPU load low