X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fpthread_frame.c;h=a63210c2092ff4db5cf89f46eda7ba859230fe0f;hb=59361d8c9d319098e3c96db2ac600030467212be;hp=5a3214caf48dda600a69d92b0ebc2152f002b5e3;hpb=952e9fbb4aaa7d424847e64514973d749d2fc931;p=ffmpeg diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index 5a3214caf48..a63210c2092 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -151,8 +151,10 @@ static attribute_align_arg void *frame_worker_thread(void *arg) if (fctx->die) break; +FF_DISABLE_DEPRECATION_WARNINGS if (!codec->update_thread_context && THREAD_SAFE_CALLBACKS(avctx)) ff_thread_finish_setup(avctx); +FF_ENABLE_DEPRECATION_WARNINGS av_frame_unref(p->frame); p->got_frame = 0; @@ -771,8 +773,10 @@ void ff_thread_flush(AVCodecContext *avctx) int ff_thread_can_start_frame(AVCodecContext *avctx) { PerThreadContext *p = avctx->internal->thread_ctx; +FF_DISABLE_DEPRECATION_WARNINGS if ((avctx->active_thread_type&FF_THREAD_FRAME) && p->state != STATE_SETTING_UP && (avctx->codec->update_thread_context || !THREAD_SAFE_CALLBACKS(avctx))) { +FF_ENABLE_DEPRECATION_WARNINGS return 0; } return 1; @@ -790,8 +794,10 @@ static int thread_get_buffer_internal(AVCodecContext *avctx, ThreadFrame *f, int if (!(avctx->active_thread_type & FF_THREAD_FRAME)) return ff_get_buffer(avctx, f->f, flags); +FF_DISABLE_DEPRECATION_WARNINGS if (p->state != STATE_SETTING_UP && (avctx->codec->update_thread_context || !THREAD_SAFE_CALLBACKS(avctx))) { +FF_ENABLE_DEPRECATION_WARNINGS av_log(avctx, AV_LOG_ERROR, "get_buffer() cannot be called after ff_thread_finish_setup()\n"); return -1; } @@ -831,9 +837,10 @@ FF_ENABLE_DEPRECATION_WARNINGS pthread_mutex_unlock(&p->progress_mutex); } +FF_DISABLE_DEPRECATION_WARNINGS if (!THREAD_SAFE_CALLBACKS(avctx) && !avctx->codec->update_thread_context) ff_thread_finish_setup(avctx); - +FF_ENABLE_DEPRECATION_WARNINGS if (err) av_buffer_unref(&f->progress);