mlpdec: Prettify substream parity check.

Originally committed as revision 18237 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Ramiro Polla 2009-03-30 03:37:19 +00:00
parent 7b18e13a7c
commit d544dcdf38
1 changed files with 6 additions and 8 deletions

View File

@ -1041,14 +1041,12 @@ static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size,
uint8_t parity, checksum;
parity = ff_mlp_calculate_parity(buf, substream_data_len[substr] - 2);
if ((parity ^ get_bits(&gb, 8)) != 0xa9)
av_log(m->avctx, AV_LOG_ERROR,
"Substream %d parity check failed.\n", substr);
checksum = ff_mlp_checksum8 (buf, substream_data_len[substr] - 2);
checksum = ff_mlp_checksum8(buf, substream_data_len[substr] - 2);
if (checksum != get_bits(&gb, 8))
av_log(m->avctx, AV_LOG_ERROR, "Substream %d checksum failed.\n",
substr);
if ((get_bits(&gb, 8) ^ parity) != 0xa9 )
av_log(m->avctx, AV_LOG_ERROR, "Substream %d parity check failed.\n", substr);
if ( get_bits(&gb, 8) != checksum)
av_log(m->avctx, AV_LOG_ERROR, "Substream %d checksum failed.\n" , substr);
}
if (substream_data_len[substr] * 8 != get_bits_count(&gb)) {
av_log(m->avctx, AV_LOG_ERROR, "substream %d length mismatch\n",