diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-23 19:28:43 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-23 19:39:42 +0100 |
commit | 8071288601cc5412f596d1cef4d5eb5f7beaf91f (patch) | |
tree | 1d21c27cb077b43072a8845350bc5747c431622c /libavcodec/mlpdec.c | |
parent | 6747b0be9b2a8e20724c6e514b3c8374c32fd6f0 (diff) | |
download | ffmpeg-8071288601cc5412f596d1cef4d5eb5f7beaf91f.tar.gz |
mlpdec: move ch_assign setup code down to after ch layout is set.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mlpdec.c')
-rw-r--r-- | libavcodec/mlpdec.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index ebd0b484a1..d96ad677e8 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -519,19 +519,6 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp, s->ch_assign[ch_assign] = ch; } - if (m->avctx->codec_id == AV_CODEC_ID_MLP && m->needs_reordering) { - if (m->avctx->channel_layout == (AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY) || - m->avctx->channel_layout == AV_CH_LAYOUT_5POINT0_BACK) { - int i = s->ch_assign[4]; - s->ch_assign[4] = s->ch_assign[3]; - s->ch_assign[3] = s->ch_assign[2]; - s->ch_assign[2] = i; - } else if (m->avctx->channel_layout == AV_CH_LAYOUT_5POINT1_BACK) { - FFSWAP(int, s->ch_assign[2], s->ch_assign[4]); - FFSWAP(int, s->ch_assign[3], s->ch_assign[5]); - } - } - checksum = ff_mlp_restart_checksum(buf, get_bits_count(gbp) - start_count); if (checksum != get_bits(gbp, 8)) @@ -563,6 +550,20 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp, if (substr == m->max_decoded_substream) { m->avctx->channels = s->max_matrix_channel + 1; m->avctx->channel_layout = s->ch_layout; + + if (m->avctx->codec_id == AV_CODEC_ID_MLP && m->needs_reordering) { + if (m->avctx->channel_layout == (AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY) || + m->avctx->channel_layout == AV_CH_LAYOUT_5POINT0_BACK) { + int i = s->ch_assign[4]; + s->ch_assign[4] = s->ch_assign[3]; + s->ch_assign[3] = s->ch_assign[2]; + s->ch_assign[2] = i; + } else if (m->avctx->channel_layout == AV_CH_LAYOUT_5POINT1_BACK) { + FFSWAP(int, s->ch_assign[2], s->ch_assign[4]); + FFSWAP(int, s->ch_assign[3], s->ch_assign[5]); + } + } + } return 0; |