Commit 998b95a6 authored by jbr's avatar jbr

set audio parameters if frame header is ok, even if crc fails

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13399 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent f4944784
...@@ -1181,15 +1181,15 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size, ...@@ -1181,15 +1181,15 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
} }
/* check for crc mismatch */ /* check for crc mismatch */
if(avctx->error_resilience >= FF_ER_CAREFUL) { if(!err && avctx->error_resilience >= FF_ER_CAREFUL) {
if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2], s->frame_size-2)) { if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2], s->frame_size-2)) {
av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n"); av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
err = 1; err = 1;
} }
} }
/* if frame is ok, set audio parameters */ /* if frame header is ok, set audio parameters */
if (!err) { if (err >= 0) {
avctx->sample_rate = s->sample_rate; avctx->sample_rate = s->sample_rate;
avctx->bit_rate = s->bit_rate; avctx->bit_rate = s->bit_rate;
......
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