[FFmpeg-devel] [PATCH 5/8] avcodec/wavpack: perform crc check at careful level
Michael Niedermayer
michaelni at gmx.at
Mon Oct 28 16:54:40 CET 2013
This improves error concealment by default
tested with 2.0_32-bit_float.wv + trasher
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
libavcodec/wavpack.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 94a4cb4..bd059f3 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -487,9 +487,11 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb,
} while (!last && count < s->samples);
wv_reset_saved_context(s);
- if ((s->avctx->err_recognition & AV_EF_CRCCHECK) &&
- wv_check_crc(s, crc, crc_extra_bits))
- return AVERROR_INVALIDDATA;
+ if (s->avctx->err_recognition & (AV_EF_CRCCHECK | AV_EF_CAREFUL)) {
+ int ret = wv_check_crc(s, crc, crc_extra_bits);
+ if (ret < 0 && s->avctx->err_recognition & (AV_EF_EXPLODE | AV_EF_CAREFUL))
+ return ret;
+ }
return 0;
}
@@ -548,9 +550,9 @@ static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb,
} while (!last && count < s->samples);
wv_reset_saved_context(s);
- if (s->avctx->err_recognition & AV_EF_CRCCHECK) {
+ if (s->avctx->err_recognition & (AV_EF_CRCCHECK | AV_EF_CAREFUL)) {
int ret = wv_check_crc(s, crc, crc_extra_bits);
- if (ret < 0 && s->avctx->err_recognition & AV_EF_EXPLODE)
+ if (ret < 0 && s->avctx->err_recognition & (AV_EF_EXPLODE | AV_EF_CAREFUL))
return ret;
}
--
1.7.9.5
More information about the ffmpeg-devel
mailing list