Also, drop redundant calls that also happen implicitly in generic code.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -84,9 +84,11 @@ static const AVOption arls_options[] = { · 83 unmodified lines | |||
| 84 | 84 | ||
| 85 | AVFILTER_DEFINE_CLASS(arls); | 85 | AVFILTER_DEFINE_CLASS(arls); |
| 86 | 86 | ||
| 87 | static int query_formats(AVFilterContext *ctx) | 87 | static int query_formats(const AVFilterContext *ctx, |
| 88 | AVFilterFormatsConfig **cfg_in, | ||
| 89 | AVFilterFormatsConfig **cfg_out) | ||
| 88 | { | 90 | { |
| 89 | AudioRLSContext *s = ctx->priv; | 91 | const AudioRLSContext *s = ctx->priv; |
| 90 | static const enum AVSampleFormat sample_fmts[3][3] = { | 92 | static const enum AVSampleFormat sample_fmts[3][3] = { |
| 91 | { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }, | 93 | { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }, |
| 92 | { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, | 94 | { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, |
| @@ -94,13 +96,11 @@ static int query_formats(AVFilterContext *ctx) · 1 unmodified line | |||
| 94 | }; | 96 | }; |
| 95 | int ret; | 97 | int ret; |
| 96 | 98 | ||
| 97 | if ((ret = ff_set_common_all_channel_counts(ctx)) < 0) | 99 | if ((ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, |
| 98 | return ret; | 100 | sample_fmts[s->precision])) < 0) |
| 99 | |||
| 100 | if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts[s->precision])) < 0) | ||
| 101 | return ret; | 101 | return ret; |
| 102 | 102 | ||
| 103 | return ff_set_common_all_samplerates(ctx); | 103 | return 0; |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | static int activate(AVFilterContext *ctx) | 106 | static int activate(AVFilterContext *ctx) |
| @@ -291,7 +291,7 @@ const AVFilter ff_af_arls = { · 184 unmodified lines | |||
| 291 | .activate = activate, | 291 | .activate = activate, |
| 292 | FILTER_INPUTS(inputs), | 292 | FILTER_INPUTS(inputs), |
| 293 | FILTER_OUTPUTS(outputs), | 293 | FILTER_OUTPUTS(outputs), |
| 294 | FILTER_QUERY_FUNC(query_formats), | 294 | FILTER_QUERY_FUNC2(query_formats), |
| 295 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | | 295 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | |
| 296 | AVFILTER_FLAG_SLICE_THREADS, | 296 | AVFILTER_FLAG_SLICE_THREADS, |
| 297 | .process_command = ff_filter_process_command, | 297 | .process_command = ff_filter_process_command, |