Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-10 02:25:31 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-13 18:36:22 +0300
commit18ec426a861c1a9a2072080796dff146bafecb53 (patch)
treed3d8b683db1ff9b6a46fd6e828e0f4c7c94ed1be /libavfilter/af_amerge.c
parent55d9d6767967794edcdd6e1bbd8840fc6f4e9315 (diff)
avfilter/formats: Factor common function combinations out
Several combinations of functions happen quite often in query_format functions; e.g. ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)) is very common. This commit therefore adds functions that are equivalent to commonly used function combinations in order to reduce code duplication. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/af_amerge.c')
-rw-r--r--libavfilter/af_amerge.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
index 2e45b7c277..7749495970 100644
--- a/libavfilter/af_amerge.c
+++ b/libavfilter/af_amerge.c
@@ -76,7 +76,6 @@ static int query_formats(AVFilterContext *ctx)
};
AMergeContext *s = ctx->priv;
int64_t inlayout[SWR_CH_MAX], outlayout = 0;
- AVFilterFormats *formats;
AVFilterChannelLayouts *layouts;
int i, ret, overlap = 0, nb_ch = 0;
@@ -129,8 +128,7 @@ static int query_formats(AVFilterContext *ctx)
if ((inlayout[i] >> c) & 1)
*(route[i]++) = out_ch_number++;
}
- formats = ff_make_format_list(packed_sample_fmts);
- if ((ret = ff_set_common_formats(ctx, formats)) < 0)
+ if ((ret = ff_set_common_formats_from_list(ctx, packed_sample_fmts)) < 0)
return ret;
for (i = 0; i < s->nb_inputs; i++) {
layouts = NULL;
@@ -145,7 +143,7 @@ static int query_formats(AVFilterContext *ctx)
if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts)) < 0)
return ret;
- return ff_set_common_samplerates(ctx, ff_all_samplerates());
+ return ff_set_common_all_samplerates(ctx);
}
static int config_output(AVFilterLink *outlink)