[FFmpeg-devel] [RFC PATCH] avfilter/video: Protect frame_pool from multi-threads access

Anton Khirnov anton at khirnov.net
Thu May 23 10:44:28 EEST 2024


Quoting Zhao Zhili (2024-05-11 06:45:12)
> 
> > On May 10, 2024, at 16:57, Zhao Zhili <quinkblack at foxmail.com> wrote:
> > 
> > From: Zhao Zhili <zhilizhao at tencent.com>
> > 
> > Fix crash with
> > ./ffplay -f lavfi -i movie=foo.mp4,drawtext=text=bar
> 
> This is an RFC because I’m not sure whether it’s a valid use case or not to call
>  ff_default_get_video_buffer2 from multiple threads. On one hand, it’s rare used
> with multithreads. On the other hand, it can be hidden deep and dangerous.

Naively it sounds like something that should not happen, since lavfi
only has slice threading and slice threads should not allocate frames.

In your example it seems to happen because of frame threading in the
movie source, but that should ideally be handled inside that filter.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list