From a9255d37815ba5df553aa6278a9d8bc7603ff458 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 3 Oct 2011 21:25:58 +0200 Subject: [PATCH] threads: warn in case of multiple finished setup calls. Signed-off-by: Michael Niedermayer --- libavcodec/pthread.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index fb5c2f1e1e2..08104914eec 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -599,6 +599,10 @@ void ff_thread_finish_setup(AVCodecContext *avctx) { if (!(avctx->active_thread_type&FF_THREAD_FRAME)) return; + if(p->state == STATE_SETUP_FINISHED){ + av_log(avctx, AV_LOG_WARNING, "Multiple ff_thread_finish_setup() calls\n"); + } + pthread_mutex_lock(&p->progress_mutex); p->state = STATE_SETUP_FINISHED; pthread_cond_broadcast(&p->progress_cond); -- 2.39.2