On Mon, Apr 22, 2013 at 04:12:51PM +0200, Janne Grunau wrote:
> 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.
> ---
> typo fixed and added !avctx->thread_safe_callbacks to the if which
> I forgot amend before sending the original patch.
> 
>  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);
> -- 

looks OK
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to