Commit ff17d8b5 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'e1b66778'

* commit 'e1b66778':
  lavc: remove the locking code in avcodec_close()

Conflicts:
	libavcodec/utils.c

Note, if someone knows of a external codec lib/API, hwaccel or other that requires
locking on its close/free side, please contact ffmpeg-devel.
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 17c8a069 e1b66778
......@@ -2671,33 +2671,22 @@ av_cold int ff_codec_close_recursive(AVCodecContext *avctx)
{
int ret = 0;
ff_unlock_avcodec();
ret = avcodec_close(avctx);
ff_lock_avcodec(NULL);
return ret;
}
av_cold int avcodec_close(AVCodecContext *avctx)
{
int ret;
if (!avctx)
return 0;
ret = ff_lock_avcodec(avctx);
if (ret < 0)
return ret;
if (avcodec_is_open(avctx)) {
FramePool *pool = avctx->internal->pool;
int i;
if (CONFIG_FRAME_THREAD_ENCODER &&
avctx->internal->frame_thread_encoder && avctx->thread_count > 1) {
ff_unlock_avcodec();
ff_frame_thread_encoder_free(avctx);
ff_lock_avcodec(avctx);
}
if (HAVE_THREADS && avctx->internal->thread_ctx)
ff_thread_free(avctx);
......@@ -2727,7 +2716,6 @@ av_cold int avcodec_close(AVCodecContext *avctx)
avctx->codec = NULL;
avctx->active_thread_type = 0;
ff_unlock_avcodec();
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment