From 310979c0394ab8572b34754ae1436537512c5afd Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 25 Oct 2023 11:05:35 +0200 Subject: [PATCH 2/4] avcodec/mlpenc: add 3.1 ch layout support for truehd Signed-off-by: Paul B Mahol --- libavcodec/mlpenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c index 27ef5f2c82..3a7893b3f0 100644 --- a/libavcodec/mlpenc.c +++ b/libavcodec/mlpenc.c @@ -600,6 +600,7 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx) break; case AV_CH_LAYOUT_2POINT1: case AV_CH_LAYOUT_SURROUND: + case AV_CH_LAYOUT_3POINT1: case AV_CH_LAYOUT_5POINT0: case AV_CH_LAYOUT_5POINT1: ctx->ch2_presentation_mod= 0; @@ -2399,12 +2400,13 @@ const FFCodec ff_truehd_encoder = { .p.priv_class = &mlp_class, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE}, .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_2POINT1, AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1) + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_2POINT1, AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_3POINT1, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, AV_CHANNEL_LAYOUT_2POINT1, AV_CHANNEL_LAYOUT_SURROUND, + AV_CHANNEL_LAYOUT_3POINT1, AV_CHANNEL_LAYOUT_5POINT0, AV_CHANNEL_LAYOUT_5POINT1, { 0 } -- 2.42.0