Fix channel order for 7.1 TrueHD samples.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Thu, 14 Apr 2011 01:43:58 +0000 (03:43 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Thu, 14 Apr 2011 01:43:58 +0000 (03:43 +0200)
libavcodec/mlpdec.c

index 71b26af..044df5b 100644 (file)
@@ -453,6 +453,11 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
             FFSWAP(int, s->ch_assign[3], s->ch_assign[5]);
         }
     }
+    if (m->avctx->codec_id == CODEC_ID_TRUEHD &&
+        m->avctx->channel_layout == AV_CH_LAYOUT_7POINT1) {
+        FFSWAP(int, s->ch_assign[4], s->ch_assign[6]);
+        FFSWAP(int, s->ch_assign[5], s->ch_assign[7]);
+    }
 
     checksum = ff_mlp_restart_checksum(buf, get_bits_count(gbp) - start_count);