mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 04:27:12 +03:00
For AAC, do not enable SBR by default
This commit is contained in:
@@ -2,9 +2,14 @@ idf_component_register(
|
|||||||
INCLUDE_DIRS . ./inc inc/alac inc/FLAC inc/helix-aac inc/mad inc/ogg inc/opus inc/opusfile inc/resample16 inc/soxr inc/vorbis
|
INCLUDE_DIRS . ./inc inc/alac inc/FLAC inc/helix-aac inc/mad inc/ogg inc/opus inc/opusfile inc/resample16 inc/soxr inc/vorbis
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (DEFINED AAC_ENABLE_SBR)
|
||||||
|
add_prebuilt_library(libhelix-aac lib/libhelix-aac-sbr.a )
|
||||||
|
else ()
|
||||||
|
add_prebuilt_library(libhelix-aac lib/libhelix-aac.a )
|
||||||
|
endif()
|
||||||
|
|
||||||
add_prebuilt_library(libmad lib/libmad.a)
|
add_prebuilt_library(libmad lib/libmad.a)
|
||||||
add_prebuilt_library(libFLAC lib/libFLAC.a )
|
add_prebuilt_library(libFLAC lib/libFLAC.a )
|
||||||
add_prebuilt_library(libhelix-aac lib/libhelix-aac.a )
|
|
||||||
add_prebuilt_library(libvorbisidec lib/libvorbisidec.a )
|
add_prebuilt_library(libvorbisidec lib/libvorbisidec.a )
|
||||||
add_prebuilt_library(libogg lib/libogg.a )
|
add_prebuilt_library(libogg lib/libogg.a )
|
||||||
add_prebuilt_library(libalac lib/libalac.a )
|
add_prebuilt_library(libalac lib/libalac.a )
|
||||||
|
|||||||
BIN
components/codecs/lib/libhelix-aac-sbr.a
Normal file
BIN
components/codecs/lib/libhelix-aac-sbr.a
Normal file
Binary file not shown.
Binary file not shown.
@@ -37,4 +37,8 @@ else()
|
|||||||
add_definitions(-DRESAMPLE16 -DBYTES_PER_FRAME=4)
|
add_definitions(-DRESAMPLE16 -DBYTES_PER_FRAME=4)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (DEFINED AAC_ENABLE_SBR)
|
||||||
|
add_definitions(-DAAC_ENABLE_SBR)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_compile_options (-O3 )
|
add_compile_options (-O3 )
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ static int read_mp4_header(unsigned long *samplerate_p, unsigned char *channels_
|
|||||||
info.nChans = (*ptr & 0x7f) >> 3;
|
info.nChans = (*ptr & 0x7f) >> 3;
|
||||||
*channels_p = info.nChans;
|
*channels_p = info.nChans;
|
||||||
// Note that 24 bits frequencies are not handled
|
// Note that 24 bits frequencies are not handled
|
||||||
|
#if AAC_ENABLE_SBR
|
||||||
if (AOT == 5 || AOT == 29) {
|
if (AOT == 5 || AOT == 29) {
|
||||||
*samplerate_p = rates[((ptr[0] & 0x03) << 1) | (ptr[1] >> 7)];
|
*samplerate_p = rates[((ptr[0] & 0x03) << 1) | (ptr[1] >> 7)];
|
||||||
LOG_WARN("AAC stream with SBR => high CPU required (use LMS proxied mode)");
|
LOG_WARN("AAC stream with SBR => high CPU required (use LMS proxied mode)");
|
||||||
@@ -172,6 +173,9 @@ static int read_mp4_header(unsigned long *samplerate_p, unsigned char *channels_
|
|||||||
*samplerate_p = 44100;
|
*samplerate_p = 44100;
|
||||||
LOG_ERROR("AAC audio object type %d not handled", AOT);
|
LOG_ERROR("AAC audio object type %d not handled", AOT);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
*samplerate_p = info.sampRateCore;
|
||||||
|
#endif
|
||||||
HAAC(a, SetRawBlockParams, a->hAac, 0, &info);
|
HAAC(a, SetRawBlockParams, a->hAac, 0, &info);
|
||||||
LOG_DEBUG("playable aac track: %u (p:%x, r:%d, c:%d, desc_len:%d)", trak, AOT, info.sampRateCore, info.nChans, desc_len);
|
LOG_DEBUG("playable aac track: %u (p:%x, r:%d, c:%d, desc_len:%d)", trak, AOT, info.sampRateCore, info.nChans, desc_len);
|
||||||
play = trak;
|
play = trak;
|
||||||
|
|||||||
Reference in New Issue
Block a user