summaryrefslogtreecommitdiff
path: root/transfer.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-08-31 12:41:19 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-08-31 12:41:19 +0200
commitab622153edfd43576768e11feef6fcb5e788c52f (patch)
tree4381ccd5069f429c6cfa8e7182b1ab48e26cd8da /transfer.c
parent105825f3127e4edc5c490d67baf34abe2983b611 (diff)
downloadvdr-ab622153edfd43576768e11feef6fcb5e788c52f.tar.gz
vdr-ab622153edfd43576768e11feef6fcb5e788c52f.tar.bz2
Now clearing the player device if there are too many poll timeouts in 'Transfer Mode'
Diffstat (limited to 'transfer.c')
-rw-r--r--transfer.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/transfer.c b/transfer.c
index 12512c33..3e24dccd 100644
--- a/transfer.c
+++ b/transfer.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: transfer.c 1.13 2003/05/18 15:15:00 kls Exp $
+ * $Id: transfer.c 1.14 2003/08/31 12:19:16 kls Exp $
*/
#include "transfer.h"
@@ -13,6 +13,7 @@
// The size of the array used to buffer video data:
// (must be larger than MINVIDEODATA - see remux.h)
#define VIDEOBUFSIZE MEGABYTE(1)
+#define POLLTIMEOUTS_BEFORE_DEVICECLEAR 3
// --- cTransfer -------------------------------------------------------------
@@ -67,6 +68,7 @@ void cTransfer::Action(void)
{
dsyslog("transfer thread started (pid=%d)", getpid());
+ int PollTimeouts = 0;
active = true;
while (active) {
@@ -99,6 +101,7 @@ void cTransfer::Action(void)
while (Result > 0 && active) {
cPoller Poller;
if (DevicePoll(Poller, 100)) {
+ PollTimeouts = 0;
int w = PlayVideo(p, Result);
if (w > 0) {
p += w;
@@ -109,6 +112,13 @@ void cTransfer::Action(void)
break;
}
}
+ else {
+ PollTimeouts++;
+ if (PollTimeouts == POLLTIMEOUTS_BEFORE_DEVICECLEAR) {
+ dsyslog("clearing device because of consecutive poll timeouts");
+ DeviceClear();
+ }
+ }
}
}
}