History

lavfi/af_sidechaincompress: convert to query_func2()

Also, drop redundant calls that also happen implicitly in generic code.

Anton Khirnov committed 2 years ago

Commit 75b2f5a1 parent 4c419971 file · +11 −10Browse files

Unified · Split

libavfilter/af_sidechaincompress.c+11−10
@@ -297,26 +297,27 @@ static int activate(AVFilterContext *ctx) · 296 unmodified lines
297297 return 0;
298298 }
299299
300−static int query_formats(AVFilterContext *ctx)
300+static int query_formats(const AVFilterContext *ctx,
301+ AVFilterFormatsConfig **cfg_in,
302+ AVFilterFormatsConfig **cfg_out)
301303 {
302304 static const enum AVSampleFormat sample_fmts[] = {
303305 AV_SAMPLE_FMT_DBL,
304306 AV_SAMPLE_FMT_NONE
305307 };
306− int ret = ff_channel_layouts_ref(ff_all_channel_counts(),
307− &ctx->inputs[1]->outcfg.channel_layouts);
308− if (ret < 0)
309− return ret;
308+ int ret;
310309
311− /* This will link the channel properties of the main input and the output;
310+ /* Generic code will link the channel properties of the main input and the output;
312311 * it won't touch the second input as its channel_layouts is already set. */
313− if ((ret = ff_set_common_all_channel_counts(ctx)) < 0)
312+ ret = ff_channel_layouts_ref(ff_all_channel_counts(),
313+ &cfg_in[1]->channel_layouts);
314+ if (ret < 0)
314315 return ret;
315316
316− if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts)) < 0)
317+ if ((ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts)) < 0)
317318 return ret;
318319
319− return ff_set_common_all_samplerates(ctx);
320+ return 0;
320321 }
321322
322323 static int config_output(AVFilterLink *outlink)
@@ -371,7 +372,7 @@ const AVFilter ff_af_sidechaincompress = { · 48 unmodified lines
371372 .uninit = uninit,
372373 FILTER_INPUTS(sidechaincompress_inputs),
373374 FILTER_OUTPUTS(sidechaincompress_outputs),
374− FILTER_QUERY_FUNC(query_formats),
375+ FILTER_QUERY_FUNC2(query_formats),
375376 .process_command = process_command,
376377 };
377378 #endif /* CONFIG_SIDECHAINCOMPRESS_FILTER */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t