Also, drop redundant calls that also happen implicitly in generic code.
Unified · Split
| @@ -154,9 +154,11 @@ typedef struct BiquadsContext { · 153 unmodified lines | ||
| 154 | 154 | void *cache, int *clip, int disabled); |
| 155 | 155 | } BiquadsContext; |
| 156 | 156 | |
| 157 | −static int query_formats(AVFilterContext *ctx) | |
| 157 | +static int query_formats(const AVFilterContext *ctx, | |
| 158 | + AVFilterFormatsConfig **cfg_in, | |
| 159 | + AVFilterFormatsConfig **cfg_out) | |
| 158 | 160 | { |
| 159 | − BiquadsContext *s = ctx->priv; | |
| 161 | + const BiquadsContext *s = ctx->priv; | |
| 160 | 162 | static const enum AVSampleFormat auto_sample_fmts[] = { |
| 161 | 163 | AV_SAMPLE_FMT_S16P, |
| 162 | 164 | AV_SAMPLE_FMT_S32P, |
| @@ -169,9 +171,7 @@ static int query_formats(AVFilterContext *ctx) · 6 unmodified lines | ||
| 169 | 171 | AV_SAMPLE_FMT_NONE |
| 170 | 172 | }; |
| 171 | 173 | 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; | |
| 175 | 175 | |
| 176 | 176 | switch (s->precision) { |
| 177 | 177 | case 0: |
| @@ -190,11 +190,11 @@ static int query_formats(AVFilterContext *ctx) · 12 unmodified lines | ||
| 190 | 190 | sample_fmts_list = auto_sample_fmts; |
| 191 | 191 | break; |
| 192 | 192 | } |
| 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); | |
| 194 | 194 | if (ret < 0) |
| 195 | 195 | return ret; |
| 196 | 196 | |
| 197 | − return ff_set_common_all_samplerates(ctx); | |
| 197 | + return 0; | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | #define BIQUAD_FILTER(name, type, ftype, min, max, need_clipping) \ |
| @@ -1463,7 +1463,7 @@ const AVFilter ff_af_##name_ = { \ · 1262 unmodified lines | ||
| 1463 | 1463 | .uninit = uninit, \ |
| 1464 | 1464 | FILTER_INPUTS(ff_audio_default_filterpad), \ |
| 1465 | 1465 | FILTER_OUTPUTS(outputs), \ |
| 1466 | − FILTER_QUERY_FUNC(query_formats), \ | |
| 1466 | + FILTER_QUERY_FUNC2(query_formats), \ | |
| 1467 | 1467 | .process_command = process_command, \ |
| 1468 | 1468 | .flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, \ |
| 1469 | 1469 | } |