From 238224efc84ab2eb66f7328c19c3f815626c50aa Mon Sep 17 00:00:00 2001 From: Johns Date: Wed, 10 Apr 2013 15:04:09 +0200 Subject: Better to unlock after the free and zero. --- codec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codec.c b/codec.c index 6e1e942..40c6cbf 100644 --- a/codec.c +++ b/codec.c @@ -515,8 +515,8 @@ void CodecVideoClose(VideoDecoder * video_decoder) if (video_decoder->VideoCtx) { pthread_mutex_lock(&CodecLockMutex); avcodec_close(video_decoder->VideoCtx); - pthread_mutex_unlock(&CodecLockMutex); av_freep(&video_decoder->VideoCtx); + pthread_mutex_unlock(&CodecLockMutex); } } @@ -856,8 +856,8 @@ void CodecAudioClose(AudioDecoder * audio_decoder) if (audio_decoder->AudioCtx) { pthread_mutex_lock(&CodecLockMutex); avcodec_close(audio_decoder->AudioCtx); - pthread_mutex_unlock(&CodecLockMutex); av_freep(&audio_decoder->AudioCtx); + pthread_mutex_unlock(&CodecLockMutex); } } -- cgit v1.2.3