History

lavfi/af_extrastereo: convert to query_func2()

Also, drop a redundant call that also happens implicitly in generic code.

Anton Khirnov committed 2 years ago

Commit 408587c1 parent 7896b951 file · +20 −9Browse files

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

Unified · Split

libavfilter/af_extrastereo.c+20−9
@@ -42,19 +42,30 @@ static const AVOption extrastereo_options[] = { · 41 unmodified lines
42 42
43AVFILTER_DEFINE_CLASS(extrastereo);43AVFILTER_DEFINE_CLASS(extrastereo);
44 44
45static int query_formats(AVFilterContext *ctx)45static 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
60static int filter_frame(AVFilterLink *inlink, AVFrame *in)71static 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};

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