diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 7e33ba5d19..1e33fbcd18 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -1025,9 +1025,9 @@ static int thread_get_buffer_internal(AVCodecContext *avctx, ThreadFrame *f, int pthread_mutex_unlock(&p->progress_mutex); - if (!avctx->codec->update_thread_context) - ff_thread_finish_setup(avctx); } + if (!avctx->thread_safe_callbacks && !avctx->codec->update_thread_context) + ff_thread_finish_setup(avctx); if (err) av_buffer_unref(&f->progress);