1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Now clearing the player device if there are too many poll timeouts in 'Transfer Mode'

This commit is contained in:
Klaus Schmidinger 2003-08-31 12:41:19 +02:00
parent 105825f312
commit ab622153ed
2 changed files with 13 additions and 1 deletions

View File

@ -2346,3 +2346,5 @@ Video Disk Recorder Revision History
menus with the DVD plugin. menus with the DVD plugin.
- Fixed handling extra blanks in plugin command lines. - Fixed handling extra blanks in plugin command lines.
- Actually implemented the SVDRP command DELC. - Actually implemented the SVDRP command DELC.
- Now clearing the player device if there are too many poll timeouts in 'Transfer
Mode', which avoids buffer overflows and black screens in such cases.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "transfer.h"
@ -13,6 +13,7 @@
// The size of the array used to buffer video data: // The size of the array used to buffer video data:
// (must be larger than MINVIDEODATA - see remux.h) // (must be larger than MINVIDEODATA - see remux.h)
#define VIDEOBUFSIZE MEGABYTE(1) #define VIDEOBUFSIZE MEGABYTE(1)
#define POLLTIMEOUTS_BEFORE_DEVICECLEAR 3
// --- cTransfer ------------------------------------------------------------- // --- cTransfer -------------------------------------------------------------
@ -67,6 +68,7 @@ void cTransfer::Action(void)
{ {
dsyslog("transfer thread started (pid=%d)", getpid()); dsyslog("transfer thread started (pid=%d)", getpid());
int PollTimeouts = 0;
active = true; active = true;
while (active) { while (active) {
@ -99,6 +101,7 @@ void cTransfer::Action(void)
while (Result > 0 && active) { while (Result > 0 && active) {
cPoller Poller; cPoller Poller;
if (DevicePoll(Poller, 100)) { if (DevicePoll(Poller, 100)) {
PollTimeouts = 0;
int w = PlayVideo(p, Result); int w = PlayVideo(p, Result);
if (w > 0) { if (w > 0) {
p += w; p += w;
@ -109,6 +112,13 @@ void cTransfer::Action(void)
break; break;
} }
} }
else {
PollTimeouts++;
if (PollTimeouts == POLLTIMEOUTS_BEFORE_DEVICECLEAR) {
dsyslog("clearing device because of consecutive poll timeouts");
DeviceClear();
}
}
} }
} }
} }