[FFmpeg-cvslog] r18762 - trunk/libavcodec/mlpdec.c

ramiro subversion
Wed May 6 17:46:11 CEST 2009


Author: ramiro
Date: Wed May  6 17:46:10 2009
New Revision: 18762

Log:
mlpdec: Split sync word error and MLP sync word check.
The previous code would print the wrong error message for MLP streams with
TrueHD noise type.

Modified:
   trunk/libavcodec/mlpdec.c

Modified: trunk/libavcodec/mlpdec.c
==============================================================================
--- trunk/libavcodec/mlpdec.c	Wed May  6 17:37:25 2009	(r18761)
+++ trunk/libavcodec/mlpdec.c	Wed May  6 17:46:10 2009	(r18762)
@@ -344,15 +344,20 @@ static int read_restart_header(MLPDecode
                                  : MAX_MATRIX_CHANNEL_TRUEHD;
 
     sync_word = get_bits(gbp, 13);
-    s->noise_type = get_bits1(gbp);
 
-    if ((m->avctx->codec_id == CODEC_ID_MLP && s->noise_type) ||
-        sync_word != 0x31ea >> 1) {
+    if (sync_word != 0x31ea >> 1) {
         av_log(m->avctx, AV_LOG_ERROR,
                "restart header sync incorrect (got 0x%04x)\n", sync_word);
         return -1;
     }
 
+    s->noise_type = get_bits1(gbp);
+
+    if (m->avctx->codec_id == CODEC_ID_MLP && s->noise_type) {
+        av_log(m->avctx, AV_LOG_ERROR, "MLP must have 0x31ea sync word.\n");
+        return -1;
+    }
+
     skip_bits(gbp, 16); /* Output timestamp */
 
     s->min_channel        = get_bits(gbp, 4);



More information about the ffmpeg-cvslog mailing list