[FFmpeg-devel] [PATCH 02/25] avfilter: always call ff_default_query_formats

Anton Khirnov anton at khirnov.net
Mon Nov 27 18:56:24 EET 2023


Quoting Niklas Haas (2023-11-09 13:19:34)
> From: Niklas Haas <git at haasn.dev>
> 
> Even if a query func is set. This is safe to do, because
> ff_default_query_formats is documented not to touch any filter lists
> that were already set by the query func.
> 
> The reason to do this is because it allows us to extend
> AVFilterFormatsConfig without having to touch every filter in existence.
> An alternative implementation of this commit would be to explicitly add
> a `ff_default_query_formats` call at the end of every query_formats
> function, but that would end up functionally equivalent to this change
> while touching a whole lot more code paths for no reason.
> 
> As a bonus, eliminates some code/logic duplication from this function.
> ---
>  libavfilter/avfiltergraph.c | 39 ++++++++++++-------------------------
>  1 file changed, 12 insertions(+), 27 deletions(-)

Looks ok.

I'm also wondering whether we could/should now remove all
ff_default_query_formats() calls from the filters and make that function
filtergraph-only.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list