From 0314fd1631454084e823e94918edb79019b96e63 Mon Sep 17 00:00:00 2001 From: Juergen Keil Date: Sat, 12 Oct 2002 17:11:58 +0000 Subject: While the demuxer mutex is unlocked, relinquish the processor in the main demuxer loop, otherwise (on solaris) demux_*_stop() has no chance to lock the mutex and change the demuxer status variable for interrupting the demuxer. Fixes xine_stop() problems on solaris. CVS patchset: 2815 CVS date: 2002/10/12 17:11:58 --- src/demuxers/demux_aiff.c | 5 ++++- src/demuxers/demux_asf.c | 5 ++++- src/demuxers/demux_avi.c | 6 +++++- src/demuxers/demux_cda.c | 5 ++++- src/demuxers/demux_elem.c | 5 ++++- src/demuxers/demux_film.c | 5 ++++- src/demuxers/demux_fli.c | 5 ++++- src/demuxers/demux_idcin.c | 4 +++- src/demuxers/demux_mpeg.c | 5 ++++- src/demuxers/demux_mpeg_block.c | 5 ++++- src/demuxers/demux_mpgaudio.c | 5 ++++- src/demuxers/demux_ogg.c | 5 ++++- src/demuxers/demux_pes.c | 5 ++++- src/demuxers/demux_qt.c | 7 +++++-- src/demuxers/demux_real.c | 5 ++++- src/demuxers/demux_roq.c | 5 ++++- src/demuxers/demux_smjpeg.c | 5 ++++- src/demuxers/demux_snd.c | 5 ++++- src/demuxers/demux_ts.c | 5 ++++- src/demuxers/demux_voc.c | 5 ++++- src/demuxers/demux_vqa.c | 5 ++++- src/demuxers/demux_wav.c | 5 ++++- src/demuxers/demux_wc3movie.c | 5 ++++- src/demuxers/demux_yuv4mpeg2.c | 5 ++++- 24 files changed, 97 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index 593f4cae0..d94dee2a2 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -19,7 +19,7 @@ * * AIFF File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_aiff.c,v 1.10 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_aiff.c,v 1.11 2002/10/12 17:11:58 jkeil Exp $ * */ @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -112,6 +113,8 @@ static void *demux_aiff_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); /* just load data chunks from wherever the stream happens to be diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index ef4ba9ec3..9f75c53a1 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_asf.c,v 1.60 2002/10/12 15:52:29 tmmm Exp $ + * $Id: demux_asf.c,v 1.61 2002/10/12 17:11:58 jkeil Exp $ * * demultiplexer for asf streams * @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -1127,6 +1128,8 @@ static void *demux_asf_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); } diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 4f73edf0d..091c8614d 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_avi.c,v 1.111 2002/09/18 22:12:16 guenter Exp $ + * $Id: demux_avi.c,v 1.112 2002/10/12 17:11:58 jkeil Exp $ * * demultiplexer for avi streams * @@ -56,6 +56,7 @@ #include #include #include +#include #include #include @@ -1044,6 +1045,7 @@ static int demux_avi_next (demux_avi_t *this) { audio_pts = get_audio_pts (this, i, audio->audio_posc, aie->tot, audio->audio_posb); if (!this->no_audio && (audio_pts < video_pts)) { + buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); /* read audio */ @@ -1136,6 +1138,8 @@ static void *demux_avi_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); } diff --git a/src/demuxers/demux_cda.c b/src/demuxers/demux_cda.c index efbb0d3b1..993d011ab 100644 --- a/src/demuxers/demux_cda.c +++ b/src/demuxers/demux_cda.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_cda.c,v 1.25 2002/09/21 20:27:02 tmmm Exp $ + * $Id: demux_cda.c,v 1.26 2002/10/12 17:11:58 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -104,6 +105,8 @@ static void *demux_cda_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); } diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c index 7f421dc99..387078b17 100644 --- a/src/demuxers/demux_elem.c +++ b/src/demuxers/demux_elem.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_elem.c,v 1.52 2002/09/18 00:51:33 guenter Exp $ + * $Id: demux_elem.c,v 1.53 2002/10/12 17:11:58 jkeil Exp $ * * demultiplexer for elementary mpeg streams * @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "xine_internal.h" @@ -110,6 +111,8 @@ static void *demux_mpeg_elem_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); } diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index c90af8828..f9977459b 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -21,7 +21,7 @@ * For more information on the FILM file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_film.c,v 1.32 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_film.c,v 1.33 2002/10/12 17:11:58 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -271,6 +272,8 @@ static void *demux_film_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); i = this->current_sample; diff --git a/src/demuxers/demux_fli.c b/src/demuxers/demux_fli.c index 48e5c32a0..53f85d545 100644 --- a/src/demuxers/demux_fli.c +++ b/src/demuxers/demux_fli.c @@ -22,7 +22,7 @@ * avoid while programming a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_fli.c,v 1.15 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_fli.c,v 1.16 2002/10/12 17:11:58 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -157,6 +158,8 @@ static void *demux_fli_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); } diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c index 217c5faba..a606dace4 100644 --- a/src/demuxers/demux_idcin.c +++ b/src/demuxers/demux_idcin.c @@ -63,7 +63,7 @@ * - if any bytes exceed 63, do not shift the bytes at all before * transmitting them to the video decoder * - * $Id: demux_idcin.c,v 1.15 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_idcin.c,v 1.16 2002/10/12 17:11:58 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -151,6 +151,8 @@ static void *demux_idcin_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); current_file_pos = this->input->get_current_pos(this->input); diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index fd392b80c..7054923ec 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpeg.c,v 1.80 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_mpeg.c,v 1.81 2002/10/12 17:11:58 jkeil Exp $ * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -774,6 +775,8 @@ static void *demux_mpeg_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); } diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 3cf1c0c55..8659b2fc0 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpeg_block.c,v 1.118 2002/10/08 10:29:42 jcdutton Exp $ + * $Id: demux_mpeg_block.c,v 1.119 2002/10/12 17:11:58 jkeil Exp $ * * demultiplexer for mpeg 1/2 program streams * @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -676,6 +677,8 @@ static void *demux_mpeg_block_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); } diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index 246aae632..0a2eac5d7 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpgaudio.c,v 1.66 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_mpgaudio.c,v 1.67 2002/10/12 17:11:58 jkeil Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -334,6 +335,8 @@ static void *demux_mpgaudio_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); } diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index f13920559..7bfa015ec 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_ogg.c,v 1.44 2002/09/19 02:00:26 guenter Exp $ + * $Id: demux_ogg.c,v 1.45 2002/10/12 17:11:58 jkeil Exp $ * * demultiplexer for ogg streams * @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -817,6 +818,8 @@ static void *demux_ogg_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); } diff --git a/src/demuxers/demux_pes.c b/src/demuxers/demux_pes.c index 5500e9c02..bce7d5fa8 100644 --- a/src/demuxers/demux_pes.c +++ b/src/demuxers/demux_pes.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_pes.c,v 1.38 2002/09/10 15:07:14 mroi Exp $ + * $Id: demux_pes.c,v 1.39 2002/10/12 17:11:58 jkeil Exp $ * * demultiplexer for mpeg 2 PES (Packetized Elementary Streams) * reads streams of variable blocksizes @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -327,6 +328,8 @@ static void *demux_pes_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); } diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 99f41e89d..7786b830d 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -30,7 +30,7 @@ * build_frame_table * free_qt_info * - * $Id: demux_qt.c,v 1.95 2002/10/08 12:45:58 jkeil Exp $ + * $Id: demux_qt.c,v 1.96 2002/10/12 17:11:58 jkeil Exp $ * */ @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -661,7 +662,7 @@ static qt_error parse_trak_atom(qt_sample_table *sample_table, /* fetch audio parameters */ sample_table->media_description.audio.codec_format = - ME_32(&trak_atom[i + 0x10]); + ME_32(&trak_atom[i + 0x10]); sample_table->media_description.audio.sample_rate = BE_16(&trak_atom[i + 0x2C]); sample_table->media_description.audio.channels = trak_atom[i + 0x25]; @@ -1437,6 +1438,8 @@ static void *demux_qt_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); i = this->current_frame; diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 53392314d..62605de3b 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -21,7 +21,7 @@ * For more information regarding the Real file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_real.c,v 1.3 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_real.c,v 1.4 2002/10/12 17:11:59 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -129,6 +130,8 @@ static void *demux_real_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); /* load a header from wherever the stream happens to be pointing */ diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c index ebebc17de..ca32985df 100644 --- a/src/demuxers/demux_roq.c +++ b/src/demuxers/demux_roq.c @@ -21,7 +21,7 @@ * For more information regarding the RoQ file format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: demux_roq.c,v 1.19 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_roq.c,v 1.20 2002/10/12 17:11:59 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -215,6 +216,8 @@ static void *demux_roq_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock(&this->mutex); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock(&this->mutex); } diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c index 1619d36a3..643bf7059 100644 --- a/src/demuxers/demux_smjpeg.c +++ b/src/demuxers/demux_smjpeg.c @@ -21,7 +21,7 @@ * For more information on the SMJPEG file format, visit: * http://www.lokigames.com/development/smjpeg.php3 * - * $Id: demux_smjpeg.c,v 1.18 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_smjpeg.c,v 1.19 2002/10/12 17:11:59 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -123,6 +124,8 @@ static void *demux_smjpeg_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); /* load the next sample */ diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c index d90099463..a4f2cf1ea 100644 --- a/src/demuxers/demux_snd.c +++ b/src/demuxers/demux_snd.c @@ -19,7 +19,7 @@ * * SND/AU File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_snd.c,v 1.11 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_snd.c,v 1.12 2002/10/12 17:11:59 jkeil Exp $ * */ @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -100,6 +101,8 @@ static void *demux_snd_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); /* just load data chunks from wherever the stream happens to be diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index 5d5b19b46..2c56b1fbc 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_ts.c,v 1.56 2002/09/10 15:07:14 mroi Exp $ + * $Id: demux_ts.c,v 1.57 2002/10/12 17:11:59 jkeil Exp $ * * Demultiplexer for MPEG2 Transport Streams. * @@ -81,6 +81,7 @@ #include #include #include +#include #include #include "xine_internal.h" @@ -1343,6 +1344,8 @@ static void *demux_ts_loop(void *gen_this) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); } diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c index 0d9e19c68..b8401ceba 100644 --- a/src/demuxers/demux_voc.c +++ b/src/demuxers/demux_voc.c @@ -23,7 +23,7 @@ * It will only play that block if it is PCM data. More variations will be * supported as they are encountered. * - * $Id: demux_voc.c,v 1.11 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_voc.c,v 1.12 2002/10/12 17:11:59 jkeil Exp $ * */ @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -101,6 +102,8 @@ static void *demux_voc_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); /* just load data chunks from wherever the stream happens to be diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c index 5af16b6f0..6087839e1 100644 --- a/src/demuxers/demux_vqa.c +++ b/src/demuxers/demux_vqa.c @@ -27,7 +27,7 @@ * block needs information from the previous audio block in order to be * decoded, thus making random seeking difficult. * - * $Id: demux_vqa.c,v 1.12 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_vqa.c,v 1.13 2002/10/12 17:11:59 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -121,6 +122,8 @@ static void *demux_vqa_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); /* load and dispatch the audio portion of the frame */ diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index 836a0562b..a7669e9f7 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -20,7 +20,7 @@ * MS WAV File Demuxer by Mike Melanson (melanson@pcisys.net) * based on WAV specs that are available far and wide * - * $Id: demux_wav.c,v 1.17 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_wav.c,v 1.18 2002/10/12 17:11:59 jkeil Exp $ * */ @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -95,6 +96,8 @@ static void *demux_wav_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); /* just load data chunks from wherever the stream happens to be diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c index 5b19de52d..68c95fb79 100644 --- a/src/demuxers/demux_wc3movie.c +++ b/src/demuxers/demux_wc3movie.c @@ -22,7 +22,7 @@ * For more information on the MVE file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_wc3movie.c,v 1.16 2002/10/06 03:48:13 komadori Exp $ + * $Id: demux_wc3movie.c,v 1.17 2002/10/12 17:11:59 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -170,6 +171,8 @@ static void *demux_mve_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); /* compensate for the initial data in the file */ diff --git a/src/demuxers/demux_yuv4mpeg2.c b/src/demuxers/demux_yuv4mpeg2.c index f668d264e..f5a088f64 100644 --- a/src/demuxers/demux_yuv4mpeg2.c +++ b/src/demuxers/demux_yuv4mpeg2.c @@ -22,7 +22,7 @@ * tools, visit: * http://mjpeg.sourceforge.net/ * - * $Id: demux_yuv4mpeg2.c,v 1.4 2002/10/08 05:05:05 tmmm Exp $ + * $Id: demux_yuv4mpeg2.c,v 1.5 2002/10/12 17:11:59 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -99,6 +100,8 @@ static void *demux_yuv4mpeg2_loop (void *this_gen) { /* someone may want to interrupt us */ pthread_mutex_unlock( &this->mutex ); + /* give demux_*_stop a chance to interrupt us */ + sched_yield(); pthread_mutex_lock( &this->mutex ); /* validate that this is an actual frame boundary */ -- cgit v1.2.3