Browse Source

Fix channel order for some less common TrueHD layouts.

Reported and tested by TDiTP_

Fixes ticket #779.
(cherry picked from commit 1af0ace3a4)
tags/n0.9.1
Carl Eugen Hoyos 14 years ago
parent
commit
55e2dc7f77
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      libavcodec/mlpdec.c

+ 8
- 0
libavcodec/mlpdec.c View File

@@ -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);


Loading…
Cancel
Save