History

lavfi/af_volume: convert to query_func2()

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

Anton Khirnov committed 2 years ago

Commit 7887d001 parent e13592c1 file · +8 −8Browse files

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

Unified · Split

libavfilter/af_volume.c+8−8
@@ -130,9 +130,11 @@ static av_cold void uninit(AVFilterContext *ctx) · 129 unmodified lines
130130 av_freep(&vol->fdsp);
131131 }
132132
133−static int query_formats(AVFilterContext *ctx)
133+static int query_formats(const AVFilterContext *ctx,
134+ AVFilterFormatsConfig **cfg_in,
135+ AVFilterFormatsConfig **cfg_out)
134136 {
135− VolumeContext *vol = ctx->priv;
137+ const VolumeContext *vol = ctx->priv;
136138 static const enum AVSampleFormat sample_fmts[][7] = {
137139 [PRECISION_FIXED] = {
138140 AV_SAMPLE_FMT_U8,
@@ -154,15 +156,13 @@ static int query_formats(AVFilterContext *ctx) · 15 unmodified lines
154156 AV_SAMPLE_FMT_NONE
155157 }
156158 };
157− int ret = ff_set_common_all_channel_counts(ctx);
158− if (ret < 0)
159− return ret;
159+ int ret;
160160
161− ret = ff_set_common_formats_from_list(ctx, sample_fmts[vol->precision]);
161+ ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts[vol->precision]);
162162 if (ret < 0)
163163 return ret;
164164
165− return ff_set_common_all_samplerates(ctx);
165+ return 0;
166166 }
167167
168168 static inline void scale_samples_u8(uint8_t *dst, const uint8_t *src,
@@ -480,7 +480,7 @@ const AVFilter ff_af_volume = { · 311 unmodified lines
480480 .uninit = uninit,
481481 FILTER_INPUTS(avfilter_af_volume_inputs),
482482 FILTER_OUTPUTS(avfilter_af_volume_outputs),
483− FILTER_QUERY_FUNC(query_formats),
483+ FILTER_QUERY_FUNC2(query_formats),
484484 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
485485 .process_command = process_command,
486486 };

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