diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-09-25 10:41:35 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-09-28 09:53:11 +0200 |
commit | 8a951ef5e119afb41e67d8b7dc3dedadc88c0e41 (patch) | |
tree | ac5ea5af4634c30264f029ee0d9df31d03d1bb80 /libavfilter/avf_showwaves.c | |
parent | fadd1dda8af3967814dfe83e88f3459b853542f7 (diff) | |
download | ffmpeg-8a951ef5e119afb41e67d8b7dc3dedadc88c0e41.tar.gz |
lavfi/avf_showwaves: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
Diffstat (limited to 'libavfilter/avf_showwaves.c')
-rw-r--r-- | libavfilter/avf_showwaves.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c index 868e6a22d9..de73d8050f 100644 --- a/libavfilter/avf_showwaves.c +++ b/libavfilter/avf_showwaves.c @@ -155,32 +155,23 @@ static av_cold void uninit(AVFilterContext *ctx) } } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { AVFilterFormats *formats = NULL; - AVFilterChannelLayouts *layouts = NULL; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; int ret; /* set input audio formats */ formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) - return ret; - - layouts = ff_all_channel_layouts(); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0) return ret; /* set output video format */ formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -814,7 +805,7 @@ const AVFilter ff_avf_showwaves = { FILTER_INPUTS(ff_audio_default_filterpad), .activate = activate, FILTER_OUTPUTS(showwaves_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &showwaves_class, }; @@ -925,7 +916,7 @@ const AVFilter ff_avf_showwavespic = { .priv_size = sizeof(ShowWavesContext), FILTER_INPUTS(showwavespic_inputs), FILTER_OUTPUTS(showwavespic_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &showwavespic_class, }; |