Also, drop redundant calls that also happen implicitly in generic code.
Unified · Split
| @@ -130,9 +130,11 @@ static av_cold void uninit(AVFilterContext *ctx) · 129 unmodified lines | |||
| 130 | av_freep(&vol->fdsp); | 130 | av_freep(&vol->fdsp); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | static int query_formats(AVFilterContext *ctx) | 133 | static int query_formats(const AVFilterContext *ctx, |
| 134 | AVFilterFormatsConfig **cfg_in, | ||
| 135 | AVFilterFormatsConfig **cfg_out) | ||
| 134 | { | 136 | { |
| 135 | VolumeContext *vol = ctx->priv; | 137 | const VolumeContext *vol = ctx->priv; |
| 136 | static const enum AVSampleFormat sample_fmts[][7] = { | 138 | static const enum AVSampleFormat sample_fmts[][7] = { |
| 137 | [PRECISION_FIXED] = { | 139 | [PRECISION_FIXED] = { |
| 138 | AV_SAMPLE_FMT_U8, | 140 | AV_SAMPLE_FMT_U8, |
| @@ -154,15 +156,13 @@ static int query_formats(AVFilterContext *ctx) · 15 unmodified lines | |||
| 154 | AV_SAMPLE_FMT_NONE | 156 | AV_SAMPLE_FMT_NONE |
| 155 | } | 157 | } |
| 156 | }; | 158 | }; |
| 157 | int ret = ff_set_common_all_channel_counts(ctx); | 159 | int ret; |
| 158 | if (ret < 0) | ||
| 159 | return ret; | ||
| 160 | 160 | ||
| 161 | ret = ff_set_common_formats_from_list(ctx, sample_fmts[vol->precision]); | 161 | ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts[vol->precision]); |
| 162 | if (ret < 0) | 162 | if (ret < 0) |
| 163 | return ret; | 163 | return ret; |
| 164 | 164 | ||
| 165 | return ff_set_common_all_samplerates(ctx); | 165 | return 0; |
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | static inline void scale_samples_u8(uint8_t *dst, const uint8_t *src, | 168 | static inline void scale_samples_u8(uint8_t *dst, const uint8_t *src, |
| @@ -480,7 +480,7 @@ const AVFilter ff_af_volume = { · 311 unmodified lines | |||
| 480 | .uninit = uninit, | 480 | .uninit = uninit, |
| 481 | FILTER_INPUTS(avfilter_af_volume_inputs), | 481 | FILTER_INPUTS(avfilter_af_volume_inputs), |
| 482 | FILTER_OUTPUTS(avfilter_af_volume_outputs), | 482 | FILTER_OUTPUTS(avfilter_af_volume_outputs), |
| 483 | FILTER_QUERY_FUNC(query_formats), | 483 | FILTER_QUERY_FUNC2(query_formats), |
| 484 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, | 484 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, |
| 485 | .process_command = process_command, | 485 | .process_command = process_command, |
| 486 | }; | 486 | }; |