aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2011-12-18 15:28:18 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-01-03 14:05:30 +0100
commit55e2dc7f77d6af421ceefb0df7d13b9d43ea91d3 (patch)
tree5b6bff6b1807875a373d1d7b939251431996364a /libavcodec
parenta46fa584c5290817b12f472f77f8343c2f9bfc1c (diff)
downloadffmpeg-55e2dc7f77d6af421ceefb0df7d13b9d43ea91d3.tar.gz
Fix channel order for some less common TrueHD layouts.
Reported and tested by TDiTP_ Fixes ticket #779. (cherry picked from commit 1af0ace3a4b8aa8c6240a99de3c40f495ab279e9)
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mlpdec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 339c75778d..47aee286ff 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -480,6 +480,14 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
m->avctx->channel_layout == AV_CH_LAYOUT_7POINT1_WIDE)) {
FFSWAP(int, s->ch_assign[4], s->ch_assign[6]);
FFSWAP(int, s->ch_assign[5], s->ch_assign[7]);
+ } else if (m->avctx->codec_id == CODEC_ID_TRUEHD &&
+ (m->avctx->channel_layout == AV_CH_LAYOUT_6POINT1 ||
+ m->avctx->channel_layout == (AV_CH_LAYOUT_6POINT1 | AV_CH_TOP_CENTER) ||
+ m->avctx->channel_layout == (AV_CH_LAYOUT_6POINT1 | AV_CH_TOP_FRONT_CENTER))) {
+ int i = s->ch_assign[6];
+ s->ch_assign[6] = s->ch_assign[5];
+ s->ch_assign[5] = s->ch_assign[4];
+ s->ch_assign[4] = i;
}
checksum = ff_mlp_restart_checksum(buf, get_bits_count(gbp) - start_count);