# HG changeset patch # User jbr # Date 1211741657 0 # Node ID 6b4bd5d667cd0d6b7eab8f2e4a1946f514546afd # Parent 5554f5ab2c19e0a15bf926645244e53fa91c2433 set audio parameters if frame header is ok, even if crc fails diff -r 5554f5ab2c19 -r 6b4bd5d667cd ac3dec.c --- a/ac3dec.c Sun May 25 18:06:01 2008 +0000 +++ b/ac3dec.c Sun May 25 18:54:17 2008 +0000 @@ -1181,15 +1181,15 @@ } /* 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)) { av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n"); err = 1; } } - /* if frame is ok, set audio parameters */ - if (!err) { + /* if frame header is ok, set audio parameters */ + if (err >= 0) { avctx->sample_rate = s->sample_rate; avctx->bit_rate = s->bit_rate;