]> git.sesse.net Git - mlt/commitdiff
Do not try to use open_mutex unless it has been init.
authorDan Dennedy <dan@dennedy.org>
Fri, 4 Oct 2013 05:55:20 +0000 (22:55 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 4 Oct 2013 05:55:20 +0000 (22:55 -0700)
src/modules/avformat/producer_avformat.c

index 9d6881d471cd6401813b5f4e4e4d3d2216871f7c..b09eb1d0f33abda2d69dc9846b5a146794a3415e 100644 (file)
@@ -2611,7 +2611,8 @@ static void producer_avformat_close( producer_avformat self )
        av_free_packet( &self->pkt );
        av_free( self->video_frame );
        av_free( self->audio_frame );
-       pthread_mutex_lock( &self->open_mutex );
+       if ( self->is_mutex_init )
+               pthread_mutex_lock( &self->open_mutex );
        int i;
        for ( i = 0; i < MAX_AUDIO_STREAMS; i++ )
        {
@@ -2640,7 +2641,8 @@ static void producer_avformat_close( producer_avformat self )
        if ( self->video_format )
                av_close_input_file( self->video_format );
 #endif
-       pthread_mutex_unlock( &self->open_mutex );
+       if ( self->is_mutex_init )
+               pthread_mutex_unlock( &self->open_mutex );
 #ifdef VDPAU
        vdpau_producer_close( self );
 #endif