History

lavfi/avf_showfreqs: switch to query_func2()

Also, drop redundant calls that also happen implicitly in generic code.

Anton Khirnov committed 2 years ago

Commit d7fde561 parent 423ecca1 file · +6 −15Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/avf_showfreqs.c+6−15
@@ -116,32 +116,23 @@ static const AVOption showfreqs_options[] = { · 115 unmodified lines
116116
117117 AVFILTER_DEFINE_CLASS(showfreqs);
118118
119−static int query_formats(AVFilterContext *ctx)
119+static int query_formats(const AVFilterContext *ctx,
120+ AVFilterFormatsConfig **cfg_in,
121+ AVFilterFormatsConfig **cfg_out)
120122 {
121123 AVFilterFormats *formats = NULL;
122− AVFilterChannelLayouts *layouts = NULL;
123− AVFilterLink *inlink = ctx->inputs[0];
124− AVFilterLink *outlink = ctx->outputs[0];
125124 static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE };
126125 static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE };
127126 int ret;
128127
129128 /* set input audio formats */
130129 formats = ff_make_format_list(sample_fmts);
131− if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0)
132− return ret;
133−
134− layouts = ff_all_channel_counts();
135− if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0)
136− return ret;
137−
138− formats = ff_all_samplerates();
139− if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0)
130+ if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0)
140131 return ret;
141132
142133 /* set output video format */
143134 formats = ff_make_format_list(pix_fmts);
144− if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0)
135+ if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0)
145136 return ret;
146137
147138 return 0;
@@ -566,6 +557,6 @@ const AVFilter ff_avf_showfreqs = { · 418 unmodified lines
566557 .activate = activate,
567558 FILTER_INPUTS(ff_audio_default_filterpad),
568559 FILTER_OUTPUTS(showfreqs_outputs),
569− FILTER_QUERY_FUNC(query_formats),
560+ FILTER_QUERY_FUNC2(query_formats),
570561 .priv_class = &showfreqs_class,
571562 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t