1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavfi/af_arnndn: convert to query_func2()

Also, drop redundant calls that also happen implicitly in generic code.
This commit is contained in:
Anton Khirnov 2024-08-31 11:21:00 +02:00
parent dfaa339167
commit b18f7d7e2d

View File

@ -327,7 +327,9 @@ static int rnnoise_model_from_file(FILE *f, RNNModel **rnn)
return 0;
}
static int query_formats(AVFilterContext *ctx)
static int query_formats(const AVFilterContext *ctx,
AVFilterFormatsConfig **cfg_in,
AVFilterFormatsConfig **cfg_out)
{
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_FLTP,
@ -335,15 +337,11 @@ static int query_formats(AVFilterContext *ctx)
};
int ret, sample_rates[] = { 48000, -1 };
ret = ff_set_common_formats_from_list(ctx, sample_fmts);
ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts);
if (ret < 0)
return ret;
ret = ff_set_common_all_channel_counts(ctx);
if (ret < 0)
return ret;
return ff_set_common_samplerates_from_list(ctx, sample_rates);
return ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, sample_rates);
}
static int config_input(AVFilterLink *inlink)
@ -1608,7 +1606,7 @@ const AVFilter ff_af_arnndn = {
.uninit = uninit,
FILTER_INPUTS(inputs),
FILTER_OUTPUTS(ff_audio_default_filterpad),
FILTER_QUERY_FUNC(query_formats),
FILTER_QUERY_FUNC2(query_formats),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
AVFILTER_FLAG_SLICE_THREADS,
.process_command = process_command,