# HG changeset patch # User ramiro # Date 1241624770 0 # Node ID 56f0a40547703bd3bf24b31adc59c41732b48efc # Parent de33a215fd84f6c05b54804b7c9383a4cc5e1c9f mlpdec: Split sync word error and MLP sync word check. The previous code would print the wrong error message for MLP streams with TrueHD noise type. diff -r de33a215fd84 -r 56f0a4054770 mlpdec.c --- a/mlpdec.c Wed May 06 15:37:25 2009 +0000 +++ b/mlpdec.c Wed May 06 15:46:10 2009 +0000 @@ -344,12 +344,17 @@ : MAX_MATRIX_CHANNEL_TRUEHD; sync_word = get_bits(gbp, 13); + + if (sync_word != 0x31ea >> 1) { + av_log(m->avctx, AV_LOG_ERROR, + "restart header sync incorrect (got 0x%04x)\n", sync_word); + return -1; + } + s->noise_type = get_bits1(gbp); - if ((m->avctx->codec_id == CODEC_ID_MLP && s->noise_type) || - sync_word != 0x31ea >> 1) { - av_log(m->avctx, AV_LOG_ERROR, - "restart header sync incorrect (got 0x%04x)\n", sync_word); + if (m->avctx->codec_id == CODEC_ID_MLP && s->noise_type) { + av_log(m->avctx, AV_LOG_ERROR, "MLP must have 0x31ea sync word.\n"); return -1; }