From 4cd65b9d97e5fb172477b31d3dc5bc136cc6950b Mon Sep 17 00:00:00 2001 From: "roman.artiukhin" Date: Fri, 22 Dec 2023 13:40:54 +0200 Subject: Codecs: mp4: Disable SBR decoding for PP5002 - PP5022 platforms Includes ipod video (5G) and earlier models, sansa c200 and others players not capable to decode AAC-HE. Allows to play backward compatible files as AAC-LC. Change-Id: Ic9f5c0f255d9a4308c3414d402f8f27f4328ca94 --- lib/rbcodec/codecs/libfaad/common.h | 4 +++- lib/rbcodec/codecs/libfaad/specrec.c | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/rbcodec/codecs/libfaad') diff --git a/lib/rbcodec/codecs/libfaad/common.h b/lib/rbcodec/codecs/libfaad/common.h index 8f66a14ce0..938f64e14c 100644 --- a/lib/rbcodec/codecs/libfaad/common.h +++ b/lib/rbcodec/codecs/libfaad/common.h @@ -135,9 +135,11 @@ extern "C" { #undef ERROR_RESILIENCE #endif -#if CODEC_SIZE >= 0x80000 +#ifdef CODEC_AAC_SBR_DEC #define SBR_DEC //#define SBR_LOW_POWER /* Does not work yet in rockbox. */ +#endif +#if CODEC_SIZE >= 0x80000 #define PS_DEC #endif diff --git a/lib/rbcodec/codecs/libfaad/specrec.c b/lib/rbcodec/codecs/libfaad/specrec.c index 200239bddc..02deb298b9 100644 --- a/lib/rbcodec/codecs/libfaad/specrec.c +++ b/lib/rbcodec/codecs/libfaad/specrec.c @@ -850,9 +850,13 @@ uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics, #if (defined(PS_DEC) || defined(DRM_PS)) if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0)) { - uint8_t ele = hDecoder->fr_ch_ele; uint8_t ch = sce->channel; - uint16_t frame_size = (hDecoder->sbr_alloced[ele]) ? 2 : 1; + uint16_t frame_size = +#ifdef SBR_DEC + (hDecoder->sbr_alloced[hDecoder->fr_ch_ele]) ? 2 : 1; +#else + 1; +#endif frame_size *= hDecoder->frameLength*sizeof(real_t); memcpy(hDecoder->time_out[ch+1], hDecoder->time_out[ch], frame_size); -- cgit v1.2.3