[FFmpeg-devel] [PATCH 1/2] lavfi: regroup formats lists in a single structure.

Nicolas George george at nsup.org
Thu Aug 20 18:05:37 EEST 2020


Andreas Rheinhardt (12020-08-18):
> 1. Adding this struct has also another benefit besides the ones in your
> two other patches: One can simplify the freeing process by adding a new
> ff_formatscfg_unref() (I'm not sure on the name). This could also be
> used in the uninit function of the aformat filter. If I am not mistaken,
> the only place outside of formats.c where one needs to unref an
> AVFilterContext/AVFilterChannelLayout is in hwdownload where one only
> needs ff_formats_unref() -- ff_channel_layouts_unref() can therefore be
> made static. (This presumes that redundant ff_*_unref() have been
> removed as is done in [1].)

Actually, I find the use of ff_formats_unref() in filter somewhat
suspicious. The functions are designed to free their arguments if
something fails, so as not to leak anything.

> 2. For the ease of backportability the double-frees/memleaks ([2] and
> the other patches from that patchset) should be applied before this one.

What is missing before applying this?

Anyway, one of the next steps I consider this is to merge
AVFilterChannelLayout into AVFilterFormats. Still with three versions of
the merge functions, but some other functions can be made generic.

That would allow to make the merge / can_merge and other functions part
of a structure of callback, and make the architecture of the negotiation
more nimble, paving the way for other media types and multi-level
negotiation.

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/20200820/afd95839/attachment.sig>


More information about the ffmpeg-devel mailing list