X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fpthread.c;h=454e51f55519edd88827e6d8645e8a40a80c54aa;hb=6c1fb3e7631178c2a45c6c41b9b8d9ee3a5298fc;hp=fb5c2f1e1e213916ac971e8d625ae8d6a621ac4c;hpb=1a34478b7183b1a08caab7eac56b452609725736;p=ffmpeg diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index fb5c2f1e1e2..454e51f5551 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -32,6 +32,7 @@ #include #include "avcodec.h" +#include "internal.h" #include "thread.h" typedef int (action_func)(AVCodecContext *c, void *arg); @@ -599,6 +600,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); @@ -783,6 +788,8 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f) f->owner = avctx; + ff_init_buffer_info(avctx, f); + if (!(avctx->active_thread_type&FF_THREAD_FRAME)) { f->thread_opaque = NULL; return avctx->get_buffer(avctx, f);