From 7616822fbb0bbe9762fe2b6271982743ac8d114e Mon Sep 17 00:00:00 2001 From: "roman.artiukhin" Date: Thu, 31 Aug 2023 18:51:16 +0300 Subject: Codecs: mp4: Ignore decode errors till next chunk present in lookup_table In files with gaps between chunks and reduced lookup_table we can't properly detect all gaps in m4a_check_sample_offset. So just ignore decode errors till next chunk present in lookup_table Change-Id: I317864dce6a2251cdb6ddb8c0ad4d7c1640cb7a1 --- lib/rbcodec/codecs/aac.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/rbcodec/codecs/aac.c b/lib/rbcodec/codecs/aac.c index 15c75708e1..1f5165ad05 100644 --- a/lib/rbcodec/codecs/aac.c +++ b/lib/rbcodec/codecs/aac.c @@ -211,7 +211,11 @@ enum codec_status codec_run(void) /* NeAACDecDecode may sometimes return NULL without setting error. */ if (ret == NULL || frame_info.error > 0) { LOGF("FAAD: decode error '%s'\n", NeAACDecGetErrorMessage(frame_info.error)); - return CODEC_ERROR; + + // In files with gaps between chunks and reduced lookup_table we can't properly detect all gaps + // in m4a_check_sample_offset. So just ignore decode errors till next chunk present in lookup_table + if (file_offset > 0) + return CODEC_ERROR; } /* Advance codec buffer (no need to call set_offset because of this) */ -- cgit v1.2.3