externals: Update faad2 and remove SBR configuration workaround. (#7128)

This commit is contained in:
Steveice10 2023-11-07 18:12:03 -08:00 committed by GitHub
parent 1d4d421097
commit 4dd6e12e46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 21 deletions

View file

@ -1,18 +1,5 @@
# Copy source to build directory for some modifications. # Sources cut down to just what we need for AAC-LC.
set(FAAD2_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/faad2/libfaad") set(FAAD2_SOURCE_DIR "faad2/libfaad")
if (NOT EXISTS "${FAAD2_SOURCE_DIR}")
file(COPY faad2/libfaad/ DESTINATION "${FAAD2_SOURCE_DIR}/")
# These are fixed defines for some reason and not controllable with compile flags.
file(READ "${FAAD2_SOURCE_DIR}/common.h" FAAD2_COMMON_H)
# Disable SBR decoding since we don't want it for AAC-LC.
string(REGEX REPLACE "#define SBR_DEC" "" FAAD2_COMMON_H "${FAAD2_COMMON_H}")
# Disable PS decoding. This can cause mono to be upmixed to stereo, which we don't want.
string(REGEX REPLACE "#define PS_DEC" "" FAAD2_COMMON_H "${FAAD2_COMMON_H}")
file(WRITE "${FAAD2_SOURCE_DIR}/common.h" "${FAAD2_COMMON_H}")
endif()
# Source list from faad2/libfaad/Makefile.am, cut down to just what we need for AAC-LC.
add_library(faad2 STATIC EXCLUDE_FROM_ALL add_library(faad2 STATIC EXCLUDE_FROM_ALL
"${FAAD2_SOURCE_DIR}/bits.c" "${FAAD2_SOURCE_DIR}/bits.c"
"${FAAD2_SOURCE_DIR}/cfft.c" "${FAAD2_SOURCE_DIR}/cfft.c"
@ -37,10 +24,9 @@ target_include_directories(faad2 PUBLIC faad2/include PRIVATE "${FAAD2_SOURCE_DI
# Configure compile definitions. # Configure compile definitions.
# Read version from autoconf script for configuring constant. # Read version from properties file for configuring constant.
file(READ faad2/configure.ac CONFIGURE_SCRIPT) file(READ faad2/properties.json FAAD_PROPERTIES_JSON)
string(REGEX MATCH "AC_INIT\\(faad2, ([0-9.]+)\\)" _ ${CONFIGURE_SCRIPT}) string(JSON FAAD_VERSION GET ${FAAD_PROPERTIES_JSON} PACKAGE_VERSION)
set(FAAD_VERSION ${CMAKE_MATCH_1})
message(STATUS "Building faad2 version ${FAAD_VERSION}") message(STATUS "Building faad2 version ${FAAD_VERSION}")
# Check for functions and headers. # Check for functions and headers.
@ -98,5 +84,5 @@ target_compile_definitions(faad2 PRIVATE
-DHAVE_SYS_TYPES_H=${HAVE_SYS_TYPES_H} -DHAVE_SYS_TYPES_H=${HAVE_SYS_TYPES_H}
-DHAVE_UNISTD_H=${HAVE_UNISTD_H} -DHAVE_UNISTD_H=${HAVE_UNISTD_H}
# Only compile for AAC-LC decoding. # Only compile for AAC-LC decoding.
-DLC_ONLY_DECODER -DLC_ONLY_DECODER -DDISABLE_SBR
) )

@ -1 +1 @@
Subproject commit 3918dee56063500d0aa23d6c3c94b211ac471a8c Subproject commit 09b3c850c606e7fedd06597223e54344e8d23c8c