Also, drop a redundant call that also happens implicitly in generic code.
Unified · Split
| @@ -118,18 +118,20 @@ static av_cold void uninit(AVFilterContext *ctx) · 117 unmodified lines | |||
| 118 | av_freep(&s->map); | 118 | av_freep(&s->map); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | static int query_formats(AVFilterContext *ctx) | 121 | static int query_formats(const AVFilterContext *ctx, |
| 122 | AVFilterFormatsConfig **cfg_in, | ||
| 123 | AVFilterFormatsConfig **cfg_out) | ||
| 122 | { | 124 | { |
| 123 | ChannelSplitContext *s = ctx->priv; | 125 | ChannelSplitContext *s = ctx->priv; |
| 124 | AVFilterChannelLayouts *in_layouts = NULL; | 126 | AVFilterChannelLayouts *in_layouts = NULL; |
| 125 | int i, ret; | 127 | int i, ret; |
| 126 | 128 | ||
| 127 | if ((ret = ff_set_common_formats(ctx, ff_planar_sample_fmts())) < 0 || | 129 | ret = ff_set_common_formats2(ctx, cfg_in, cfg_out, ff_planar_sample_fmts()); |
| 128 | (ret = ff_set_common_all_samplerates(ctx)) < 0) | 130 | if (ret < 0) |
| 129 | return ret; | 131 | return ret; |
| 130 | 132 | ||
| 131 | if ((ret = ff_add_channel_layout(&in_layouts, &s->channel_layout)) < 0 || | 133 | if ((ret = ff_add_channel_layout(&in_layouts, &s->channel_layout)) < 0 || |
| 132 | (ret = ff_channel_layouts_ref(in_layouts, &ctx->inputs[0]->outcfg.channel_layouts)) < 0) | 134 | (ret = ff_channel_layouts_ref(in_layouts, &cfg_in[0]->channel_layouts)) < 0) |
| 133 | return ret; | 135 | return ret; |
| 134 | 136 | ||
| 135 | for (i = 0; i < ctx->nb_outputs; i++) { | 137 | for (i = 0; i < ctx->nb_outputs; i++) { |
| @@ -156,7 +158,7 @@ static int query_formats(AVFilterContext *ctx) · 20 unmodified lines | |||
| 156 | if (ret < 0) | 158 | if (ret < 0) |
| 157 | return ret; | 159 | return ret; |
| 158 | 160 | ||
| 159 | ret = ff_channel_layouts_ref(out_layouts, &ctx->outputs[i]->incfg.channel_layouts); | 161 | ret = ff_channel_layouts_ref(out_layouts, &cfg_out[i]->channel_layouts); |
| 160 | if (ret < 0) | 162 | if (ret < 0) |
| 161 | return ret; | 163 | return ret; |
| 162 | } | 164 | } |
| @@ -249,6 +251,6 @@ const AVFilter ff_af_channelsplit = { · 86 unmodified lines | |||
| 249 | .uninit = uninit, | 251 | .uninit = uninit, |
| 250 | FILTER_INPUTS(ff_audio_default_filterpad), | 252 | FILTER_INPUTS(ff_audio_default_filterpad), |
| 251 | .outputs = NULL, | 253 | .outputs = NULL, |
| 252 | FILTER_QUERY_FUNC(query_formats), | 254 | FILTER_QUERY_FUNC2(query_formats), |
| 253 | .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS, | 255 | .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS, |
| 254 | }; | 256 | }; |