From 919c00ba5af0521428a954ea976586f1b23f957e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 19 Nov 2011 20:41:30 +0100 Subject: [PATCH] alsdec: update checked AV_EF flags. A user who wishes to use default error concealment cannot set the AV_EF_CRCCHECK flag because not every CRC in every format is a reliable indicator of bitstream damage. In some formats crcrs can be nonsensical in absence of any damage. We thus add the AV_EF_CAREFUL flag in addition to the AV_EF_CRCCHECK flag to allow a user to enable this reliable CRC check without having to enable all CRC checks in all formats. Signed-off-by: Michael Niedermayer --- libavcodec/alsdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index d1055266d4..fdcbd3fb44 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -393,7 +393,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx) if (get_bits_left(&gb) < 32) return -1; - if (avctx->err_recognition & AV_EF_CRCCHECK) { + if (avctx->err_recognition & (AV_EF_CRCCHECK|AV_EF_CAREFUL)) { ctx->crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE); ctx->crc = 0xFFFFFFFF; ctx->crc_org = ~get_bits_long(&gb, 32); @@ -1476,7 +1476,7 @@ static int decode_frame(AVCodecContext *avctx, } // update CRC - if (sconf->crc_enabled && (avctx->err_recognition & AV_EF_CRCCHECK)) { + if (sconf->crc_enabled && (avctx->err_recognition & (AV_EF_CRCCHECK|AV_EF_CAREFUL))) { int swap = HAVE_BIGENDIAN != sconf->msb_first; if (ctx->avctx->bits_per_raw_sample == 24) { @@ -1710,7 +1710,7 @@ static av_cold int decode_init(AVCodecContext *avctx) // allocate crc buffer if (HAVE_BIGENDIAN != sconf->msb_first && sconf->crc_enabled && - (avctx->err_recognition & AV_EF_CRCCHECK)) { + (avctx->err_recognition & (AV_EF_CRCCHECK|AV_EF_CAREFUL))) { ctx->crc_buffer = av_malloc(sizeof(*ctx->crc_buffer) * ctx->cur_frame_length * avctx->channels *