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

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/af_sidechaincompress.c+11−10
@@ -297,26 +297,27 @@ static int activate(AVFilterContext *ctx) · 296 unmodified lines
297 return 0;297 return 0;
298}298}
299 299
300static int query_formats(AVFilterContext *ctx)300static int query_formats(const AVFilterContext *ctx,
301 AVFilterFormatsConfig **cfg_in,
302 AVFilterFormatsConfig **cfg_out)
301{303{
302 static const enum AVSampleFormat sample_fmts[] = {304 static const enum AVSampleFormat sample_fmts[] = {
303 AV_SAMPLE_FMT_DBL,305 AV_SAMPLE_FMT_DBL,
304 AV_SAMPLE_FMT_NONE306 AV_SAMPLE_FMT_NONE
305 };307 };
306 int ret = ff_channel_layouts_ref(ff_all_channel_counts(),308 int ret;
307 &ctx->inputs[1]->outcfg.channel_layouts);
308 if (ret < 0)
309 return ret;
310 309
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;
312 * it won't touch the second input as its channel_layouts is already set. */311 * 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)
314 return ret;315 return ret;
315 316
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)
317 return ret;318 return ret;
318 319
319 return ff_set_common_all_samplerates(ctx);320 return 0;
320}321}
321 322
322static int config_output(AVFilterLink *outlink)323static int config_output(AVFilterLink *outlink)
@@ -371,7 +372,7 @@ const AVFilter ff_af_sidechaincompress = { · 48 unmodified lines
371 .uninit = uninit,372 .uninit = uninit,
372 FILTER_INPUTS(sidechaincompress_inputs),373 FILTER_INPUTS(sidechaincompress_inputs),
373 FILTER_OUTPUTS(sidechaincompress_outputs),374 FILTER_OUTPUTS(sidechaincompress_outputs),
374 FILTER_QUERY_FUNC(query_formats),375 FILTER_QUERY_FUNC2(query_formats),
375 .process_command = process_command,376 .process_command = process_command,
376};377};
377#endif /* CONFIG_SIDECHAINCOMPRESS_FILTER */378#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