/** the output buffer size */
#define AAC_OUTBUF_SIZE (32 * 1024)
+#define MAX_ERRORS 20
+
/**
* data specific to the aacdec filter
*
int initialized;
int decoder_length;
+ unsigned error_count;
size_t consumed_total;
size_t entry;
};
p = inbuf + consumed;
outbuffer = NeAACDecDecode(padd->handle, &padd->frame_info, p,
len - consumed);
- ret = -E_AAC_DECODE;
if (padd->frame_info.error) {
+ ret = -E_AAC_DECODE;
+ if (padd->error_count++ > MAX_ERRORS)
+ goto out;
PARA_ERROR_LOG("frame_error: %d, consumed: %zu + %zd + %lu\n",
padd->frame_info.error, padd->consumed_total,
consumed, padd->frame_info.bytesconsumed);
consumed++; /* catch 21 */
goto success;
}
+ padd->error_count = 0;
consumed += padd->frame_info.bytesconsumed;
ret = consumed;
if (!padd->frame_info.samples)