1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

imc: make issue non-fatal

The "faulty" samples actually sound fine when ignoring this issue.

For ticket #3886, more samples are decoded.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Christophe Gisquet
2014-12-04 00:04:50 +01:00
committed by Michael Niedermayer
parent 0f6931f4b6
commit 291747581e

View File

@@ -790,7 +790,8 @@ static int inverse_quant_coeff(IMCContext *q, IMCChannel *chctx,
} }
static int imc_get_coeffs(IMCContext *q, IMCChannel *chctx) static void imc_get_coeffs(AVCodecContext *avctx,
IMCContext *q, IMCChannel *chctx)
{ {
int i, j, cw_len, cw; int i, j, cw_len, cw;
@@ -803,8 +804,9 @@ static int imc_get_coeffs(IMCContext *q, IMCChannel *chctx)
cw = 0; cw = 0;
if (get_bits_count(&q->gb) + cw_len > 512) { if (get_bits_count(&q->gb) + cw_len > 512) {
av_dlog(NULL, "Band %i coeff %i cw_len %i\n", i, j, cw_len); av_log(avctx, AV_LOG_WARNING,
return AVERROR_INVALIDDATA; "Potential problem on band %i, coefficient %i"
": cw_len=%i\n", i, j, cw_len);
} }
if (cw_len && (!chctx->bandFlagsBuf[i] || !chctx->skipFlags[j])) if (cw_len && (!chctx->bandFlagsBuf[i] || !chctx->skipFlags[j]))
@@ -814,7 +816,6 @@ static int imc_get_coeffs(IMCContext *q, IMCChannel *chctx)
} }
} }
} }
return 0;
} }
static void imc_refine_bit_allocation(IMCContext *q, IMCChannel *chctx) static void imc_refine_bit_allocation(IMCContext *q, IMCChannel *chctx)
@@ -995,11 +996,7 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch)
memset(chctx->codewords, 0, sizeof(chctx->codewords)); memset(chctx->codewords, 0, sizeof(chctx->codewords));
if (imc_get_coeffs(q, chctx) < 0) { imc_get_coeffs(avctx, q, chctx);
av_log(avctx, AV_LOG_ERROR, "Read coefficients failed\n");
chctx->decoder_reset = 1;
return AVERROR_INVALIDDATA;
}
if (inverse_quant_coeff(q, chctx, stream_format_code) < 0) { if (inverse_quant_coeff(q, chctx, stream_format_code) < 0) {
av_log(avctx, AV_LOG_ERROR, "Inverse quantization of coefficients failed\n"); av_log(avctx, AV_LOG_ERROR, "Inverse quantization of coefficients failed\n");