summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThibaut Mattern <tmattern@users.sourceforge.net>2002-11-01 11:15:05 +0000
committerThibaut Mattern <tmattern@users.sourceforge.net>2002-11-01 11:15:05 +0000
commit341edb6593830583adbd69ac96205f69f6d4f0ca (patch)
tree84c2d55b6f8d69d15b48fab1bd9739c82c637cc1 /src
parentac05c37c1ac529a4622c3c1e66d778fbfe96c885 (diff)
downloadxine-lib-341edb6593830583adbd69ac96205f69f6d4f0ca.tar.gz
xine-lib-341edb6593830583adbd69ac96205f69f6d4f0ca.tar.bz2
Fix seeking at the end of the stream.
CVS patchset: 3123 CVS date: 2002/11/01 11:15:05
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/demux.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index f4d7c0679..8990db584 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -171,11 +171,12 @@ static void *demux_loop (void *stream_gen) {
#ifdef LOG
printf ("demux: main demuxer loop finished (status: %d)\n", status);
#endif
+
/* wait before sending end buffers: user might want to do a new seek */
while(stream->demux_thread_running &&
- (!stream->video_fifo || stream->video_fifo->size(stream->video_fifo)) &&
- (!stream->audio_fifo || stream->audio_fifo->size(stream->audio_fifo)) &&
- status != DEMUX_OK ){
+ ((!stream->video_fifo || stream->video_fifo->size(stream->video_fifo)) ||
+ (!stream->audio_fifo || stream->audio_fifo->size(stream->audio_fifo))) &&
+ status == DEMUX_FINISHED ){
pthread_mutex_unlock( &stream->demux_lock );
xine_usec_sleep(100000);
pthread_mutex_lock( &stream->demux_lock );
@@ -194,12 +195,12 @@ static void *demux_loop (void *stream_gen) {
} else {
xine_demux_control_end(stream, BUF_FLAG_END_USER);
}
-
+
stream->demux_thread_running = 0;
+
pthread_mutex_unlock( &stream->demux_lock );
-
- pthread_exit(NULL);
+ pthread_exit(NULL);
return NULL;
}
@@ -258,7 +259,7 @@ int xine_demux_stop_thread (xine_stream_t *stream) {
stream->demux_thread = 0;
pthread_mutex_unlock (&stream->counter_lock);
-
+
/*
* Wake up xine_play if it's waiting for a frame
*/
@@ -268,6 +269,6 @@ int xine_demux_stop_thread (xine_stream_t *stream) {
pthread_cond_signal(&stream->first_frame_reached);
}
pthread_mutex_unlock (&stream->first_frame_lock);
-
+
return 0;
}