[FFmpeg-cvslog] avcodec/thd: fix special stereo support

Paul B Mahol git at videolan.org
Sat Dec 18 11:27:15 EET 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Nov 18 15:12:20 2021 +0100| [a8a7c5d502a851d16c4668e03bff12d0e16c32b8] | committer: Paul B Mahol

avcodec/thd: fix special stereo support

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a8a7c5d502a851d16c4668e03bff12d0e16c32b8
---

 libavcodec/mlpdec.c | 4 +++-
 libavcodec/mlpenc.c | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 780ed5b7b6..29fac54542 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -408,7 +408,9 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
                         mh.stream_type);
             return AVERROR_PATCHWELCOME;
         }
-        if (mh.channel_modifier_thd_stream0 == THD_CH_MODIFIER_STEREO)
+        if (mh.channels_thd_stream1 == 2 &&
+            mh.channels_thd_stream2 == 2 &&
+            m->avctx->channels == 2)
             m->substream[0].mask = AV_CH_LAYOUT_STEREO;
         if ((substr = (mh.num_substreams > 1)))
             m->substream[0].mask = AV_CH_LAYOUT_STEREO;
diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
index 1cb02f22a9..d8783b6f56 100644
--- a/libavcodec/mlpenc.c
+++ b/libavcodec/mlpenc.c
@@ -626,7 +626,7 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx)
             ctx->ch_modifier_thd0    = 0;
             ctx->ch_modifier_thd1    = 0;
             ctx->ch_modifier_thd2    = 0;
-            ctx->channel_arrangement = 0;
+            ctx->channel_arrangement = 1;
             break;
         case AV_CH_LAYOUT_5POINT0_BACK:
             ctx->ch_modifier_thd0    = 1;



More information about the ffmpeg-cvslog mailing list