[FFmpeg-cvslog] threads: always call thread_finish_setup for intra codecs

Janne Grunau git at videolan.org
Tue Apr 23 10:25:25 CEST 2013


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Mon Apr 22 15:31:58 2013 +0200| [94660c35249e11c53b9a9f0c2f85c4335b21eda7] | committer: Janne Grunau

threads: always call thread_finish_setup for intra codecs

Intra codecs do not need an update_thread_context() function and never
call ff_thread_finish_setup(). They rely on ff_thread_get_buffer()
calling it. So call it even if the get_buffer2 function pointer is
avcodec_default_get_buffer2 and it has not been called before.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=94660c35249e11c53b9a9f0c2f85c4335b21eda7
---

 libavcodec/pthread.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 404804d..1dbfe3d 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -947,9 +947,9 @@ int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
 
         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);



More information about the ffmpeg-cvslog mailing list