From 9d86dca48419b4dd4bbaa3dd0f855c3d12f38605 Mon Sep 17 00:00:00 2001 From: Thibaut Mattern Date: Thu, 31 Oct 2002 21:58:41 +0000 Subject: Little optimization. CVS patchset: 3116 CVS date: 2002/10/31 21:58:41 --- src/xine-engine/demux.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 4f7ee1dca..f4d7c0679 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -158,14 +158,14 @@ static void *demux_loop (void *stream_gen) { status = stream->demux_plugin->send_chunk(stream->demux_plugin); /* someone may want to interrupt us */ - pthread_mutex_unlock( &stream->demux_lock ); if( stream->demux_action_pending ) { + pthread_mutex_unlock( &stream->demux_lock ); #ifdef LOG printf ("demux: sched_yield\n"); #endif sched_yield(); + pthread_mutex_lock( &stream->demux_lock ); } - pthread_mutex_lock( &stream->demux_lock ); } #ifdef LOG @@ -211,7 +211,9 @@ int xine_demux_start_thread (xine_stream_t *stream) { printf ("demux: start thread called\n"); #endif + stream->demux_action_pending = 1; pthread_mutex_lock( &stream->demux_lock ); + stream->demux_action_pending = 0; if( !stream->demux_thread_running ) { -- cgit v1.2.3