From edff8fd5744069608128007d840ae9b23dc32966 Mon Sep 17 00:00:00 2001 From: James Courtier-Dutton Date: Sun, 16 May 2004 21:45:24 +0000 Subject: From: Reinhard Nissl. The fix stopps dropping properly received data. I realized the problem when switching channels in VDR. From time to time, it happend that switching took more than 50 ms (the timeout value used in _x_read_abort()), which caused the select() to timeout. In the case where 'stream->demux_action_pending' was set, the already received data was dropped due to returning 0. This finally resulted in your demuxer to fail with DEMUX_END, as it couldn't read 6 bytes from the PES header. So for the case, that there is some data available, it now takes twice the timeout (i. e. 100 ms), before a return 0 happens. Some more information: as in rare cases switching channels could take even longer than 100 ms, I've also added a loop around _x_read_about() in my VDR input plugin, which returns 0 just after this state lasts for 5 seconds. CVS patchset: 6557 CVS date: 2004/05/16 21:45:24 --- src/xine-engine/demux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 0708d3e51..6399c0776 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -20,7 +20,7 @@ * Demuxer helper functions * hide some xine engine details from demuxers and reduce code duplication * - * $Id: demux.c,v 1.48 2004/04/07 18:10:20 valtri Exp $ + * $Id: demux.c,v 1.49 2004/05/16 21:45:24 jcdutton Exp $ */ @@ -431,7 +431,7 @@ off_t _x_read_abort (xine_stream_t *stream, int fd, char *buf, off_t todo) { * cannot be stopped when no more data is available. */ if( stream->demux_action_pending ) - return 0; + return total; } else { break; } -- cgit v1.2.3