From 4dd6e12e46ec63ee3fc7939bed095679fe280520 Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Tue, 7 Nov 2023 18:12:03 -0800 Subject: [PATCH] externals: Update faad2 and remove SBR configuration workaround. (#7128) --- externals/faad2/CMakeLists.txt | 26 ++++++-------------------- externals/faad2/faad2 | 2 +- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/externals/faad2/CMakeLists.txt b/externals/faad2/CMakeLists.txt index ac73f13d1..87ea66eb6 100644 --- a/externals/faad2/CMakeLists.txt +++ b/externals/faad2/CMakeLists.txt @@ -1,18 +1,5 @@ -# Copy source to build directory for some modifications. -set(FAAD2_SOURCE_DIR "${CMAKE_CURRENT_BINARY_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. +# Sources cut down to just what we need for AAC-LC. +set(FAAD2_SOURCE_DIR "faad2/libfaad") add_library(faad2 STATIC EXCLUDE_FROM_ALL "${FAAD2_SOURCE_DIR}/bits.c" "${FAAD2_SOURCE_DIR}/cfft.c" @@ -37,10 +24,9 @@ target_include_directories(faad2 PUBLIC faad2/include PRIVATE "${FAAD2_SOURCE_DI # Configure compile definitions. -# Read version from autoconf script for configuring constant. -file(READ faad2/configure.ac CONFIGURE_SCRIPT) -string(REGEX MATCH "AC_INIT\\(faad2, ([0-9.]+)\\)" _ ${CONFIGURE_SCRIPT}) -set(FAAD_VERSION ${CMAKE_MATCH_1}) +# Read version from properties file for configuring constant. +file(READ faad2/properties.json FAAD_PROPERTIES_JSON) +string(JSON FAAD_VERSION GET ${FAAD_PROPERTIES_JSON} PACKAGE_VERSION) message(STATUS "Building faad2 version ${FAAD_VERSION}") # Check for functions and headers. @@ -98,5 +84,5 @@ target_compile_definitions(faad2 PRIVATE -DHAVE_SYS_TYPES_H=${HAVE_SYS_TYPES_H} -DHAVE_UNISTD_H=${HAVE_UNISTD_H} # Only compile for AAC-LC decoding. - -DLC_ONLY_DECODER + -DLC_ONLY_DECODER -DDISABLE_SBR ) diff --git a/externals/faad2/faad2 b/externals/faad2/faad2 index 3918dee56..09b3c850c 160000 --- a/externals/faad2/faad2 +++ b/externals/faad2/faad2 @@ -1 +1 @@ -Subproject commit 3918dee56063500d0aa23d6c3c94b211ac471a8c +Subproject commit 09b3c850c606e7fedd06597223e54344e8d23c8c