Also, drop redundant calls that also happen implicitly in generic code.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -321,21 +321,28 @@ static av_cold int channelmap_init(AVFilterContext *ctx) · 320 unmodified lines | |||
| 321 | return 0; | 321 | return 0; |
| 322 | } | 322 | } |
| 323 | 323 | ||
| 324 | static int channelmap_query_formats(AVFilterContext *ctx) | 324 | static int channelmap_query_formats(const AVFilterContext *ctx, |
| 325 | AVFilterFormatsConfig **cfg_in, | ||
| 326 | AVFilterFormatsConfig **cfg_out) | ||
| 325 | { | 327 | { |
| 326 | ChannelMapContext *s = ctx->priv; | 328 | const ChannelMapContext *s = ctx->priv; |
| 327 | AVFilterChannelLayouts *channel_layouts = NULL; | 329 | AVFilterChannelLayouts *channel_layouts = NULL; |
| 330 | |||
| 328 | int ret; | 331 | int ret; |
| 329 | 332 | ||
| 330 | if ((ret = ff_set_common_formats (ctx, ff_planar_sample_fmts())) < 0 || | 333 | ret = ff_set_common_formats2(ctx, cfg_in, cfg_out, ff_planar_sample_fmts()); |
| 331 | (ret = ff_set_common_all_samplerates(ctx )) < 0 || | 334 | if (ret < 0) |
| 332 | (ret = ff_add_channel_layout(&channel_layouts, &s->output_layout)) < 0 || | 335 | return ret; |
| 333 | (ret = ff_channel_layouts_ref(channel_layouts, | 336 | |
| 334 | &ctx->outputs[0]->incfg.channel_layouts)) < 0) | 337 | ret = ff_add_channel_layout(&channel_layouts, &s->output_layout); |
| 338 | if (ret < 0) | ||
| 339 | return ret; | ||
| 340 | |||
| 341 | ret = ff_channel_layouts_ref(channel_layouts, &cfg_out[0]->channel_layouts); | ||
| 342 | if (ret < 0) | ||
| 335 | return ret; | 343 | return ret; |
| 336 | 344 | ||
| 337 | return ff_channel_layouts_ref(ff_all_channel_counts(), | 345 | return 0; |
| 338 | &ctx->inputs[0]->outcfg.channel_layouts); | ||
| 339 | } | 346 | } |
| 340 | 347 | ||
| 341 | static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf) | 348 | static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf) |
| @@ -425,5 +432,5 @@ const AVFilter ff_af_channelmap = { · 83 unmodified lines | |||
| 425 | .priv_class = &channelmap_class, | 432 | .priv_class = &channelmap_class, |
| 426 | FILTER_INPUTS(avfilter_af_channelmap_inputs), | 433 | FILTER_INPUTS(avfilter_af_channelmap_inputs), |
| 427 | FILTER_OUTPUTS(ff_audio_default_filterpad), | 434 | FILTER_OUTPUTS(ff_audio_default_filterpad), |
| 428 | FILTER_QUERY_FUNC(channelmap_query_formats), | 435 | FILTER_QUERY_FUNC2(channelmap_query_formats), |
| 429 | }; | 436 | }; |