diff options
Diffstat (limited to 'src/demuxers/demux_qt.c')
-rw-r--r-- | src/demuxers/demux_qt.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 46e2dce82..872c640db 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.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_qt.c,v 1.31 2002/05/20 16:58:02 miguelfreitas Exp $ + * $Id: demux_qt.c,v 1.32 2002/05/21 00:17:55 tmattern Exp $ * * demultiplexer for mpeg-4 system (aka quicktime) streams, based on: * @@ -4203,7 +4203,7 @@ static void demux_qt_create_index (demux_qt_t *this) { printf ("demux_qt: index generation done.\n"); } -static void demux_qt_start (demux_plugin_t *this_gen, +static int demux_qt_start (demux_plugin_t *this_gen, fifo_buffer_t *video_fifo, fifo_buffer_t *audio_fifo, off_t start_pos, int start_time) { @@ -4211,6 +4211,7 @@ static void demux_qt_start (demux_plugin_t *this_gen, demux_qt_t *this = (demux_qt_t *) this_gen; buf_element_t *buf; int err; + int status; pthread_mutex_lock( &this->mutex ); @@ -4230,14 +4231,16 @@ static void demux_qt_start (demux_plugin_t *this_gen, if (!this->qt) { this->status = DEMUX_FINISHED; + status = this->status; pthread_mutex_unlock( &this->mutex ); - return; + return status; } if (!demux_qt_detect_compressors (this)) { this->status = DEMUX_FINISHED; + status = this->status; pthread_mutex_unlock( &this->mutex ); - return; + return status; } xine_log (this->xine, XINE_LOG_FORMAT, @@ -4334,15 +4337,20 @@ static void demux_qt_start (demux_plugin_t *this_gen, else { xine_flush_engine(this->xine); } - pthread_mutex_unlock( &this->mutex ); + /* this->status is saved because we can be interrupted between + * pthread_mutex_unlock and return + */ + status = this->status; + pthread_mutex_unlock( &this->mutex ); + return status; } -static void demux_qt_seek (demux_plugin_t *this_gen, +static int demux_qt_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time) { demux_qt_t *this = (demux_qt_t *) this_gen; - demux_qt_start (this_gen, this->video_fifo, this->audio_fifo, + return demux_qt_start (this_gen, this->video_fifo, this->audio_fifo, start_pos, start_time); } |