Commit 0ae814d2 authored by ramiro's avatar ramiro

mlpdec: Prettify substream parity check.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18237 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 27ddc196
...@@ -1041,14 +1041,12 @@ static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size, ...@@ -1041,14 +1041,12 @@ static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size,
uint8_t parity, checksum; uint8_t parity, checksum;
parity = ff_mlp_calculate_parity(buf, substream_data_len[substr] - 2); parity = ff_mlp_calculate_parity(buf, substream_data_len[substr] - 2);
if ((parity ^ get_bits(&gb, 8)) != 0xa9) checksum = ff_mlp_checksum8 (buf, substream_data_len[substr] - 2);
av_log(m->avctx, AV_LOG_ERROR,
"Substream %d parity check failed.\n", substr);
checksum = ff_mlp_checksum8(buf, substream_data_len[substr] - 2); if ((get_bits(&gb, 8) ^ parity) != 0xa9 )
if (checksum != get_bits(&gb, 8)) av_log(m->avctx, AV_LOG_ERROR, "Substream %d parity check failed.\n", substr);
av_log(m->avctx, AV_LOG_ERROR, "Substream %d checksum failed.\n", if ( get_bits(&gb, 8) != checksum)
substr); av_log(m->avctx, AV_LOG_ERROR, "Substream %d checksum failed.\n" , substr);
} }
if (substream_data_len[substr] * 8 != get_bits_count(&gb)) { if (substream_data_len[substr] * 8 != get_bits_count(&gb)) {
av_log(m->avctx, AV_LOG_ERROR, "substream %d length mismatch\n", av_log(m->avctx, AV_LOG_ERROR, "substream %d length mismatch\n",
......
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