Signed-off-by: Vittorio Giovara <[email protected]>
---
libavfilter/af_aformat.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c
index f0746737dc..c5aa4f7148 100644
--- a/libavfilter/af_aformat.c
+++ b/libavfilter/af_aformat.c
@@ -94,6 +94,13 @@ static int get_sample_rate(const char *samplerate)
return FFMAX(ret, 0);
}
+static int get_channel_layout(const char *channel_layout)
+{
+ AVChannelLayout ch_layout = {0};
+ av_channel_layout_from_string(&ch_layout, channel_layout);
+ return ch_layout.u.mask;
+}
+
static av_cold int init(AVFilterContext *ctx)
{
AFormatContext *s = ctx->priv;
@@ -103,8 +110,7 @@ static av_cold int init(AVFilterContext *ctx)
PARSE_FORMATS(s->sample_rates_str, int, s->sample_rates, ff_add_format,
get_sample_rate, 0, "sample rate");
PARSE_FORMATS(s->channel_layouts_str, uint64_t, s->channel_layouts,
- ff_add_channel_layout, av_get_channel_layout, 0,
- "channel layout");
+ ff_add_channel_layout, get_channel_layout, 0, "channel
layout");
return 0;
}
--
2.12.0
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel