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 | AVFILTER_DEFINE_CLASS(extrastereo); | 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; | 49 | static const enum AVSampleFormat formats[] = { |
| 48 | AVFilterChannelLayouts *layout = NULL; | 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 | int ret; | 58 | int ret; |
| 50 | 59 | ||
| 51 | if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_FLT )) < 0 || | 60 | ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats); |
| 52 | (ret = ff_set_common_formats (ctx , formats )) < 0 || | 61 | if (ret < 0) |
| 53 | (ret = ff_add_channel_layout (&layout , &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) < 0 || | 62 | return ret; |
| 54 | (ret = ff_set_common_channel_layouts (ctx , layout )) < 0) | 63 | |
| 64 | ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); | ||
| 65 | if (ret < 0) | ||
| 55 | return ret; | 66 | return ret; |
| 56 | 67 | ||
| 57 | return ff_set_common_all_samplerates(ctx); | 68 | return 0; |
| 58 | } | 69 | } |
| 59 | 70 | ||
| 60 | static int filter_frame(AVFilterLink *inlink, AVFrame *in) | 71 | static int filter_frame(AVFilterLink *inlink, AVFrame *in) |
| @@ -118,7 +129,7 @@ const AVFilter ff_af_extrastereo = { · 57 unmodified lines | |||
| 118 | .priv_class = &extrastereo_class, | 129 | .priv_class = &extrastereo_class, |
| 119 | FILTER_INPUTS(inputs), | 130 | FILTER_INPUTS(inputs), |
| 120 | FILTER_OUTPUTS(ff_audio_default_filterpad), | 131 | FILTER_OUTPUTS(ff_audio_default_filterpad), |
| 121 | FILTER_QUERY_FUNC(query_formats), | 132 | FILTER_QUERY_FUNC2(query_formats), |
| 122 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, | 133 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, |
| 123 | .process_command = ff_filter_process_command, | 134 | .process_command = ff_filter_process_command, |
| 124 | }; | 135 | }; |