History

lavfi/af_biquads: convert to query_func2()

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

Anton Khirnov committed 2 years ago

Commit 96a8a611 parent 2e899d31 file · +8 −8Browse files

Unified · Split

libavfilter/af_biquads.c+8−8
@@ -154,9 +154,11 @@ typedef struct BiquadsContext { · 153 unmodified lines
154154 void *cache, int *clip, int disabled);
155155 } BiquadsContext;
156156
157−static int query_formats(AVFilterContext *ctx)
157+static int query_formats(const AVFilterContext *ctx,
158+ AVFilterFormatsConfig **cfg_in,
159+ AVFilterFormatsConfig **cfg_out)
158160 {
159− BiquadsContext *s = ctx->priv;
161+ const BiquadsContext *s = ctx->priv;
160162 static const enum AVSampleFormat auto_sample_fmts[] = {
161163 AV_SAMPLE_FMT_S16P,
162164 AV_SAMPLE_FMT_S32P,
@@ -169,9 +171,7 @@ static int query_formats(AVFilterContext *ctx) · 6 unmodified lines
169171 AV_SAMPLE_FMT_NONE
170172 };
171173 const enum AVSampleFormat *sample_fmts_list = sample_fmts;
172− int ret = ff_set_common_all_channel_counts(ctx);
173− if (ret < 0)
174− return ret;
174+ int ret;
175175
176176 switch (s->precision) {
177177 case 0:
@@ -190,11 +190,11 @@ static int query_formats(AVFilterContext *ctx) · 12 unmodified lines
190190 sample_fmts_list = auto_sample_fmts;
191191 break;
192192 }
193− ret = ff_set_common_formats_from_list(ctx, sample_fmts_list);
193+ ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts_list);
194194 if (ret < 0)
195195 return ret;
196196
197− return ff_set_common_all_samplerates(ctx);
197+ return 0;
198198 }
199199
200200 #define BIQUAD_FILTER(name, type, ftype, min, max, need_clipping) \
@@ -1463,7 +1463,7 @@ const AVFilter ff_af_##name_ = { \ · 1262 unmodified lines
14631463 .uninit = uninit, \
14641464 FILTER_INPUTS(ff_audio_default_filterpad), \
14651465 FILTER_OUTPUTS(outputs), \
1466− FILTER_QUERY_FUNC(query_formats), \
1466+ FILTER_QUERY_FUNC2(query_formats), \
14671467 .process_command = process_command, \
14681468 .flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, \
14691469 }

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