comparison mlpdec.c @ 9613:56f0a4054770 libavcodec

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.
author ramiro
date Wed, 06 May 2009 15:46:10 +0000
parents de33a215fd84
children 2d9e7d5cd89b
comparison
equal deleted inserted replaced
9612:de33a215fd84 9613:56f0a4054770
342 const int max_matrix_channel = m->avctx->codec_id == CODEC_ID_MLP 342 const int max_matrix_channel = m->avctx->codec_id == CODEC_ID_MLP
343 ? MAX_MATRIX_CHANNEL_MLP 343 ? MAX_MATRIX_CHANNEL_MLP
344 : MAX_MATRIX_CHANNEL_TRUEHD; 344 : MAX_MATRIX_CHANNEL_TRUEHD;
345 345
346 sync_word = get_bits(gbp, 13); 346 sync_word = get_bits(gbp, 13);
347
348 if (sync_word != 0x31ea >> 1) {
349 av_log(m->avctx, AV_LOG_ERROR,
350 "restart header sync incorrect (got 0x%04x)\n", sync_word);
351 return -1;
352 }
353
347 s->noise_type = get_bits1(gbp); 354 s->noise_type = get_bits1(gbp);
348 355
349 if ((m->avctx->codec_id == CODEC_ID_MLP && s->noise_type) || 356 if (m->avctx->codec_id == CODEC_ID_MLP && s->noise_type) {
350 sync_word != 0x31ea >> 1) { 357 av_log(m->avctx, AV_LOG_ERROR, "MLP must have 0x31ea sync word.\n");
351 av_log(m->avctx, AV_LOG_ERROR,
352 "restart header sync incorrect (got 0x%04x)\n", sync_word);
353 return -1; 358 return -1;
354 } 359 }
355 360
356 skip_bits(gbp, 16); /* Output timestamp */ 361 skip_bits(gbp, 16); /* Output timestamp */
357 362