summaryrefslogtreecommitdiff
path: root/src/xine-engine/demux.c
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-10-30 17:51:13 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-10-30 17:51:13 +0000
commit7e1601a85ba1f6640c717a02a64a136da23e7165 (patch)
treeed576d246baba59232957bbb0e71fca8186b40eb /src/xine-engine/demux.c
parentc0a6fe55488467a5ceaeb2073b99e9503b3031db (diff)
downloadxine-lib-7e1601a85ba1f6640c717a02a64a136da23e7165.tar.gz
xine-lib-7e1601a85ba1f6640c717a02a64a136da23e7165.tar.bz2
- add mutex on seeking and avoid overuse of sched_yield
CVS patchset: 3102 CVS date: 2002/10/30 17:51:13
Diffstat (limited to 'src/xine-engine/demux.c')
-rw-r--r--src/xine-engine/demux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index 56917e71b..222a293e4 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -159,7 +159,8 @@ static void *demux_loop (void *stream_gen) {
/* someone may want to interrupt us */
pthread_mutex_unlock( &stream->demux_lock );
- sched_yield();
+ if( stream->demux_action_pending )
+ sched_yield();
pthread_mutex_lock( &stream->demux_lock );
}
@@ -231,8 +232,10 @@ int xine_demux_stop_thread (xine_stream_t *stream) {
printf ("demux: stop thread called\n");
#endif
+ stream->demux_action_pending = 1;
pthread_mutex_lock( &stream->demux_lock );
stream->demux_thread_running = 0;
+ stream->demux_action_pending = 0;
pthread_mutex_unlock( &stream->demux_lock );
#ifdef LOG