summaryrefslogtreecommitdiff
path: root/src/xine-engine/demux.c
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-12-19 20:24:30 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-12-19 20:24:30 +0000
commite1019bfd4706a9ab58e68c33e4c4d8aae2489557 (patch)
tree8a158d2bee82b11e3f2484befbd2d46cf4710342 /src/xine-engine/demux.c
parent709552aeea14284f980ace3e71c786c26f0371d5 (diff)
downloadxine-lib-e1019bfd4706a9ab58e68c33e4c4d8aae2489557.tar.gz
xine-lib-e1019bfd4706a9ab58e68c33e4c4d8aae2489557.tar.bz2
stop stream if audio device failed to open. user receives a notification
and should check if any other application is using the device. CVS patchset: 7282 CVS date: 2004/12/19 20:24:30
Diffstat (limited to 'src/xine-engine/demux.c')
-rw-r--r--src/xine-engine/demux.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index 4b4049464..27c63d2a7 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -20,7 +20,7 @@
* Demuxer helper functions
* hide some xine engine details from demuxers and reduce code duplication
*
- * $Id: demux.c,v 1.53 2004/10/30 12:45:27 miguelfreitas Exp $
+ * $Id: demux.c,v 1.54 2004/12/19 20:24:31 miguelfreitas Exp $
*/
@@ -243,13 +243,15 @@ static void *demux_loop (void *stream_gen) {
lprintf ("loop starting...\n");
pthread_mutex_lock( &stream->demux_lock );
-
+ stream->emergency_brake = 0;
+
/* do-while needed to seek after demux finished */
do {
/* main demuxer loop */
status = stream->demux_plugin->get_status(stream->demux_plugin);
- while(status == DEMUX_OK && stream->demux_thread_running) {
+ while(status == DEMUX_OK && stream->demux_thread_running &&
+ !stream->emergency_brake) {
status = stream->demux_plugin->send_chunk(stream->demux_plugin);
@@ -275,14 +277,15 @@ static void *demux_loop (void *stream_gen) {
while(stream->demux_thread_running &&
((stream->video_fifo->size(stream->video_fifo)) ||
(stream->audio_fifo->size(stream->audio_fifo))) &&
- status == DEMUX_FINISHED ){
+ status == DEMUX_FINISHED && !stream->emergency_brake){
pthread_mutex_unlock( &stream->demux_lock );
xine_usec_sleep(100000);
pthread_mutex_lock( &stream->demux_lock );
status = stream->demux_plugin->get_status(stream->demux_plugin);
}
- } while( status == DEMUX_OK && stream->demux_thread_running );
+ } while( status == DEMUX_OK && stream->demux_thread_running &&
+ !stream->emergency_brake);
lprintf ("loop finished (status: %d)\n", status);