[FFmpeg-devel] [PATCH v2 05/14] avfilter/af_aresample: Use preinit instead of init_dict

Nicolas George george at nsup.org
Thu Sep 16 15:36:58 EEST 2021


Andreas Rheinhardt (12021-09-14):
> By using preinit, the SwrContext already exists directly after
> allocating the filter, so that the filter's AVClass's child_next
> becomes usable for setting options with the AV_OPT_SEARCH_CHILDREN
> search flag. This means that it is no longer necessary to use
> the init_dict callback for this filter.
> 
> Furthermore, the earlier code did not abide by the documentation
> of the init_dict callback at all: Instead of only returning the
> options that have not been recognized it always returned all options
> on any av_opt_set() error and errored out in this case; yet if
> the error was just caused by an unrecognized option, it should not
> error out at all and instead return said option.
> 
> This behaviour has been inherited by avfilter_init_dict(),
> contradicting its documentation. This is also fixed by this commit.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
>  libavfilter/af_aresample.c | 27 +++++++--------------------
>  1 file changed, 7 insertions(+), 20 deletions(-)

This looks like a good change. Thanks.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210916/ffd2dc16/attachment.sig>


More information about the ffmpeg-devel mailing list