diff options
author | Thibaut Mattern <tmattern@users.sourceforge.net> | 2003-03-30 15:19:45 +0000 |
---|---|---|
committer | Thibaut Mattern <tmattern@users.sourceforge.net> | 2003-03-30 15:19:45 +0000 |
commit | c26901e3c59aa88bc0071633a667430316b1ded4 (patch) | |
tree | 5589f8fa0be58cae5631577328f5c327b4cb018d /src/xine-engine/demux.c | |
parent | 939c40b7ab92c779734e5aa15a7714b1ae54b26b (diff) | |
download | xine-lib-c26901e3c59aa88bc0071633a667430316b1ded4.tar.gz xine-lib-c26901e3c59aa88bc0071633a667430316b1ded4.tar.bz2 |
New net_buf_ctrl.
See xine-devel for details.
Basicaly it adds callbacks to fifo, and everything is done at fifo level now.
It fixes deadlocks with ogg/ogm streams, pauses the engine at the right time, and evaluates better the length of the data in fifos (using pts when the bitrate is not constant).
Enjoy.
CVS patchset: 4513
CVS date: 2003/03/30 15:19:45
Diffstat (limited to 'src/xine-engine/demux.c')
-rw-r--r-- | src/xine-engine/demux.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 1edfac777..88c5515f5 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -160,7 +160,7 @@ void xine_demux_control_start( xine_stream_t *stream ) { void xine_demux_control_end( xine_stream_t *stream, uint32_t flags ) { buf_element_t *buf; - + buf = stream->video_fifo->buffer_pool_alloc (stream->video_fifo); buf->type = BUF_CONTROL_END; buf->decoder_flags = flags; @@ -174,15 +174,32 @@ void xine_demux_control_end( xine_stream_t *stream, uint32_t flags ) { } } +void xine_demux_control_nop( xine_stream_t *stream, uint32_t flags ) { + + buf_element_t *buf; + + buf = stream->video_fifo->buffer_pool_alloc (stream->video_fifo); + buf->type = BUF_CONTROL_NOP; + buf->decoder_flags = flags; + stream->video_fifo->put (stream->video_fifo, buf); + + if (stream->audio_fifo) { + buf = stream->audio_fifo->buffer_pool_alloc (stream->audio_fifo); + buf->type = BUF_CONTROL_NOP; + buf->decoder_flags = flags; + stream->audio_fifo->put (stream->audio_fifo, buf); + } +} + static void *demux_loop (void *stream_gen) { xine_stream_t *stream = (xine_stream_t *)stream_gen; int status; - + #ifdef LOG printf ("demux: loop starting...\n"); #endif - + pthread_mutex_lock( &stream->demux_lock ); /* do-while needed to seek after demux finished */ @@ -208,13 +225,9 @@ 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 */ + xine_demux_control_nop(stream, BUF_FLAG_END_STREAM); while(stream->demux_thread_running && ((!stream->video_fifo || stream->video_fifo->size(stream->video_fifo)) || (stream->audio_out |