[FFmpeg-devel] [PATCH 2/2] avcodec/decode: sync side_data_pref_mask across worker threads
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Sun Apr 27 21:52:09 EEST 2025
James Almer:
> side_data_pref_mask is set during ff_decode_preinit() and then never copied to
> worker threads. As such, any decoder calling one of the side data helpers that
> rely on side_data_pref() in frame threaded scenarios will ignore the user set
> list of side data types.
>
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> libavcodec/decode.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index c2b2dd6e3b..20e99b3ffb 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
> @@ -2209,6 +2209,7 @@ void ff_decode_internal_sync(AVCodecContext *dst, const AVCodecContext *src)
> const DecodeContext *src_dc = decode_ctx(src->internal);
> DecodeContext *dst_dc = decode_ctx(dst->internal);
>
> + dst_dc->side_data_pref_mask = src_dc->side_data_pref_mask;
> av_refstruct_replace(&dst_dc->lcevc, src_dc->lcevc);
> }
>
Why is this done for every frame, even though it does not change after
preinit?
- Andreas
More information about the ffmpeg-devel
mailing list