[FFmpeg-devel] [PATCH] lavfi: add mbfequalizer filter.

James Almer jamrial at gmail.com
Mon Dec 23 15:15:18 EET 2019


On 12/23/2019 8:17 AM, Nicolas George wrote:
> TODO changelog and version bump
> 
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  doc/filters.texi              |  48 +++
>  libavfilter/Makefile          |   1 +
>  libavfilter/af_mbfequalizer.c | 567 ++++++++++++++++++++++++++++++++++
>  libavfilter/allfilters.c      |   1 +
>  4 files changed, 617 insertions(+)
>  create mode 100644 libavfilter/af_mbfequalizer.c
> 
> 
> I think I'll rewrite the bands parser to allow per-channel options and make
> the structure of the code clearer. But I can already send the whole patch
> for your consideration.

[...]

> +static int filter_frame(AVFilterLink *link, AVFrame *frame)
> +{
> +    AVFilterContext *ctx = link->dst;
> +    EqContext *s = ctx->priv;
> +    AVFrame *frame_out;
> +
> +    if (av_frame_is_writable(frame)) {
> +        frame_out = frame;
> +    } else {
> +        frame_out = ff_get_audio_buffer(ctx->outputs[0], frame->nb_samples);
> +        if (!frame_out) {
> +            av_frame_free(&frame);
> +            return AVERROR(ENOMEM);
> +        }
> +    }

Can't you use av_frame_make_writable() instead to simplify this?


More information about the ffmpeg-devel mailing list