Also, drop a redundant call that also happens implicitly in generic code.
Unified · Split
| @@ -42,19 +42,30 @@ static const AVOption extrastereo_options[] = { · 41 unmodified lines | ||
| 42 | 42 | |
| 43 | 43 | AVFILTER_DEFINE_CLASS(extrastereo); |
| 44 | 44 | |
| 45 | −static int query_formats(AVFilterContext *ctx) | |
| 45 | +static int query_formats(const AVFilterContext *ctx, | |
| 46 | + AVFilterFormatsConfig **cfg_in, | |
| 47 | + AVFilterFormatsConfig **cfg_out) | |
| 46 | 48 | { |
| 47 | − AVFilterFormats *formats = NULL; | |
| 48 | − AVFilterChannelLayouts *layout = NULL; | |
| 49 | + static const enum AVSampleFormat formats[] = { | |
| 50 | + AV_SAMPLE_FMT_FLT, | |
| 51 | + AV_SAMPLE_FMT_NONE, | |
| 52 | + }; | |
| 53 | + static const AVChannelLayout layouts[] = { | |
| 54 | + AV_CHANNEL_LAYOUT_STEREO, | |
| 55 | + { .nb_channels = 0 }, | |
| 56 | + }; | |
| 57 | + | |
| 49 | 58 | int ret; |
| 50 | 59 | |
| 51 | − if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_FLT )) < 0 || | |
| 52 | − (ret = ff_set_common_formats (ctx , formats )) < 0 || | |
| 53 | − (ret = ff_add_channel_layout (&layout , &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) < 0 || | |
| 54 | − (ret = ff_set_common_channel_layouts (ctx , layout )) < 0) | |
| 60 | + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats); | |
| 61 | + if (ret < 0) | |
| 62 | + return ret; | |
| 63 | + | |
| 64 | + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); | |
| 65 | + if (ret < 0) | |
| 55 | 66 | return ret; |
| 56 | 67 | |
| 57 | − return ff_set_common_all_samplerates(ctx); | |
| 68 | + return 0; | |
| 58 | 69 | } |
| 59 | 70 | |
| 60 | 71 | static int filter_frame(AVFilterLink *inlink, AVFrame *in) |
| @@ -118,7 +129,7 @@ const AVFilter ff_af_extrastereo = { · 57 unmodified lines | ||
| 118 | 129 | .priv_class = &extrastereo_class, |
| 119 | 130 | FILTER_INPUTS(inputs), |
| 120 | 131 | FILTER_OUTPUTS(ff_audio_default_filterpad), |
| 121 | − FILTER_QUERY_FUNC(query_formats), | |
| 132 | + FILTER_QUERY_FUNC2(query_formats), | |
| 122 | 133 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, |
| 123 | 134 | .process_command = ff_filter_process_command, |
| 124 | 135 | }; |