Also, drop a redundant call that also happens implicitly in generic code.
Unified · Split
| @@ -81,19 +81,29 @@ static const AVOption haas_options[] = { · 80 unmodified lines | |||
| 81 | 81 | ||
| 82 | AVFILTER_DEFINE_CLASS(haas); | 82 | AVFILTER_DEFINE_CLASS(haas); |
| 83 | 83 | ||
| 84 | static int query_formats(AVFilterContext *ctx) | 84 | static int query_formats(const AVFilterContext *ctx, |
| 85 | AVFilterFormatsConfig **cfg_in, | ||
| 86 | AVFilterFormatsConfig **cfg_out) | ||
| 85 | { | 87 | { |
| 86 | AVFilterFormats *formats = NULL; | 88 | static const enum AVSampleFormat formats[] = { |
| 87 | AVFilterChannelLayouts *layout = NULL; | 89 | AV_SAMPLE_FMT_DBL, |
| 90 | AV_SAMPLE_FMT_NONE, | ||
| 91 | }; | ||
| 92 | static const AVChannelLayout layouts[] = { | ||
| 93 | AV_CHANNEL_LAYOUT_STEREO, | ||
| 94 | { .nb_channels = 0 }, | ||
| 95 | }; | ||
| 88 | int ret; | 96 | int ret; |
| 89 | 97 | ||
| 90 | if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_DBL )) < 0 || | 98 | ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats); |
| 91 | (ret = ff_set_common_formats (ctx , formats )) < 0 || | 99 | if (ret < 0) |
| 92 | (ret = ff_add_channel_layout (&layout , &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) < 0 || | ||
| 93 | (ret = ff_set_common_channel_layouts (ctx , layout )) < 0) | ||
| 94 | return ret; | 100 | return ret; |
| 95 | 101 | ||
| 96 | return ff_set_common_all_samplerates(ctx); | 102 | ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); |
| 103 | if (ret < 0) | ||
| 104 | return ret; | ||
| 105 | |||
| 106 | return 0; | ||
| 97 | } | 107 | } |
| 98 | 108 | ||
| 99 | static int config_input(AVFilterLink *inlink) | 109 | static int config_input(AVFilterLink *inlink) |
| @@ -216,5 +226,5 @@ const AVFilter ff_af_haas = { · 116 unmodified lines | |||
| 216 | .uninit = uninit, | 226 | .uninit = uninit, |
| 217 | FILTER_INPUTS(inputs), | 227 | FILTER_INPUTS(inputs), |
| 218 | FILTER_OUTPUTS(ff_audio_default_filterpad), | 228 | FILTER_OUTPUTS(ff_audio_default_filterpad), |
| 219 | FILTER_QUERY_FUNC(query_formats), | 229 | FILTER_QUERY_FUNC2(query_formats), |
| 220 | }; | 230 | }; |