diff options
author | Thibaut Mattern <tmattern@users.sourceforge.net> | 2003-02-23 23:49:17 +0000 |
---|---|---|
committer | Thibaut Mattern <tmattern@users.sourceforge.net> | 2003-02-23 23:49:17 +0000 |
commit | 964017d1b29f76548ff48d4d36e14366b15730ba (patch) | |
tree | 054e8d16fb4fd8c274f6f7d44f603abfa7016b0f /src | |
parent | a60910ab30ff4daa2c5c6aa5cc889526f278548f (diff) | |
download | xine-lib-964017d1b29f76548ff48d4d36e14366b15730ba.tar.gz xine-lib-964017d1b29f76548ff48d4d36e14366b15730ba.tar.bz2 |
Fixes a deadlock when buffering at the end of the stream.
CVS patchset: 4277
CVS date: 2003/02/23 23:49:17
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-engine/demux.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 63189d5f4..9ef4c6a69 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -31,9 +31,7 @@ #include "demuxers/demux.h" #include "buffer.h" -/* #define LOG -*/ /* internal use only - called from demuxers on seek/stop * warning: after clearing decoders fifos an absolute discontinuity @@ -202,11 +200,16 @@ static void *demux_loop (void *stream_gen) { #ifdef LOG printf ("demux: main demuxer loop finished (status: %d)\n", status); #endif - + /* Avoid deadlock with net_buf_ctrl */ + stream->xine->clock->set_speed (stream->xine->clock, XINE_SPEED_NORMAL); + stream->xine->clock->set_option (stream->xine->clock, CLOCK_SCR_ADJUSTABLE, 1); + if (stream->audio_out) + stream->audio_out->set_property(stream->audio_out,AO_PROP_PAUSED,0); + /* wait before sending end buffers: user might want to do a new seek */ - while(stream->demux_thread_running && + while(stream->demux_thread_running && ((!stream->video_fifo || stream->video_fifo->size(stream->video_fifo)) || - (stream->audio_out + (stream->audio_out && (!stream->audio_fifo || stream->audio_fifo->size(stream->audio_fifo)))) && status == DEMUX_FINISHED ){ pthread_mutex_unlock( &stream->demux_lock ); @@ -220,8 +223,8 @@ static void *demux_loop (void *stream_gen) { #ifdef LOG printf ("demux: loop finished (status: %d)\n", status); #endif - - /* demux_thread_running is zero is demux loop has being stopped by user */ + + /* demux_thread_running is zero if demux loop has being stopped by user */ if (stream->demux_thread_running) { xine_demux_control_end(stream, BUF_FLAG_END_STREAM); } else { |