diff options
Diffstat (limited to 'src/demuxers/demux_avi.c')
-rw-r--r-- | src/demuxers/demux_avi.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 053a6d891..dab5d091a 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.87 2002/05/20 16:58:02 miguelfreitas Exp $ + * $Id: demux_avi.c,v 1.88 2002/05/21 00:12:31 siggi Exp $ * * demultiplexer for avi streams * @@ -1122,8 +1122,8 @@ static int demux_avi_next (demux_avi_t *this) { } static void *demux_avi_loop (void *this_gen) { - buf_element_t *buf = NULL; + demux_avi_t *this = (demux_avi_t *) this_gen; pthread_mutex_lock( &this->mutex ); @@ -1231,10 +1231,10 @@ static int demux_avi_get_status (demux_plugin_t *this_gen) { return (this->thread_running?DEMUX_OK:DEMUX_FINISHED); } -static void demux_avi_start (demux_plugin_t *this_gen, - fifo_buffer_t *video_fifo, - fifo_buffer_t *audio_fifo, - off_t start_pos, int start_time) { +static int demux_avi_start (demux_plugin_t *this_gen, + fifo_buffer_t *video_fifo, + fifo_buffer_t *audio_fifo, + off_t start_pos, int start_time) { demux_avi_t *this = (demux_avi_t *) this_gen; int i; @@ -1243,6 +1243,7 @@ static void demux_avi_start (demux_plugin_t *this_gen, int err; unsigned char *sub; video_index_entry_t *vie = NULL; + int status; pthread_mutex_lock( &this->mutex ); @@ -1472,7 +1473,12 @@ static void demux_avi_start (demux_plugin_t *this_gen, } } + /* 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; } @@ -1480,8 +1486,8 @@ static void demux_avi_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time) { demux_avi_t *this = (demux_avi_t *) this_gen; - demux_avi_start (this_gen, this->video_fifo, this->audio_fifo, - start_pos, start_time); + return demux_avi_start (this_gen, this->video_fifo, this->audio_fifo, + start_pos, start_time); } static int demux_avi_open(demux_plugin_t *this_gen, |