Commit 85eded42 authored by ramiro's avatar ramiro

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.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18762 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 6d9c8770
...@@ -344,15 +344,20 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp, ...@@ -344,15 +344,20 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
: MAX_MATRIX_CHANNEL_TRUEHD; : MAX_MATRIX_CHANNEL_TRUEHD;
sync_word = get_bits(gbp, 13); sync_word = get_bits(gbp, 13);
s->noise_type = get_bits1(gbp);
if ((m->avctx->codec_id == CODEC_ID_MLP && s->noise_type) || if (sync_word != 0x31ea >> 1) {
sync_word != 0x31ea >> 1) {
av_log(m->avctx, AV_LOG_ERROR, av_log(m->avctx, AV_LOG_ERROR,
"restart header sync incorrect (got 0x%04x)\n", sync_word); "restart header sync incorrect (got 0x%04x)\n", sync_word);
return -1; return -1;
} }
s->noise_type = get_bits1(gbp);
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;
}
skip_bits(gbp, 16); /* Output timestamp */ skip_bits(gbp, 16); /* Output timestamp */
s->min_channel = get_bits(gbp, 4); s->min_channel = get_bits(gbp, 4);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment