[FFmpeg-cvslog] mlpdec: move ch_assign setup code down to after ch layout is set.
Michael Niedermayer
git at videolan.org
Wed Jan 23 19:41:20 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jan 23 19:28:43 2013 +0100| [8071288601cc5412f596d1cef4d5eb5f7beaf91f] | committer: Michael Niedermayer
mlpdec: move ch_assign setup code down to after ch layout is set.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8071288601cc5412f596d1cef4d5eb5f7beaf91f
---
libavcodec/mlpdec.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index ebd0b48..d96ad67 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;
More information about the ffmpeg-cvslog
mailing list