[FFmpeg-cvslog] avcodec/mlp: move sync defines to common header

Paul B Mahol git at videolan.org
Sun Sep 5 19:15:19 EEST 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Sep  5 18:10:53 2021 +0200| [0c87b43c6cd45a66c54134026d2f2cf823df4c7d] | committer: Paul B Mahol

avcodec/mlp: move sync defines to common header

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

 libavcodec/mlp.h    | 3 +++
 libavcodec/mlpdec.c | 4 ++--
 libavcodec/mlpenc.c | 3 ---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/mlp.h b/libavcodec/mlp.h
index 5b7d8c8cac..e45eba55ae 100644
--- a/libavcodec/mlp.h
+++ b/libavcodec/mlp.h
@@ -24,6 +24,9 @@
 
 #include <stdint.h>
 
+#define SYNC_MLP        0xbb
+#define SYNC_TRUEHD     0xba
+
 /** Last possible matrix channel for each codec */
 #define MAX_MATRIX_CHANNEL_MLP      5
 #define MAX_MATRIX_CHANNEL_TRUEHD   7
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 08db5dc63c..4320cb4524 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -391,7 +391,7 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
      * substream is Stereo. Subsequent substreams' layouts are indicated in the
      * major sync. */
     if (m->avctx->codec_id == AV_CODEC_ID_MLP) {
-        if (mh.stream_type != 0xbb) {
+        if (mh.stream_type != SYNC_MLP) {
             avpriv_request_sample(m->avctx,
                         "unexpected stream_type %X in MLP",
                         mh.stream_type);
@@ -401,7 +401,7 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
             m->substream[0].mask = AV_CH_LAYOUT_STEREO;
         m->substream[substr].mask = mh.channel_layout_mlp;
     } else {
-        if (mh.stream_type != 0xba) {
+        if (mh.stream_type != SYNC_TRUEHD) {
             avpriv_request_sample(m->avctx,
                         "unexpected stream_type %X in !MLP",
                         mh.stream_type);
diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
index d686f0a3e1..e38abf7f13 100644
--- a/libavcodec/mlpenc.c
+++ b/libavcodec/mlpenc.c
@@ -215,9 +215,6 @@ static const BestOffset restart_best_offset[NUM_CODEBOOKS] = {{0}};
 #define SYNC_MAJOR      0xf8726f
 #define MAJOR_SYNC_INFO_SIGNATURE   0xB752
 
-#define SYNC_MLP        0xbb
-#define SYNC_TRUEHD     0xba
-
 /* must be set for DVD-A */
 #define FLAGS_DVDA      0x4000
 /* FIFO delay must be constant */



More information about the ffmpeg-cvslog mailing list