|
|
|
@@ -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; |
|
|
|
} |
|
|
|
|
|
|
|
|