From f6451bf6c5d489a0f6cc88efd43b81a0f4ef9759 Mon Sep 17 00:00:00 2001 From: Lubos Dolezel Date: Fri, 28 Feb 2014 22:12:30 +0100 Subject: [PATCH] Fixing AudioToolbox build troubles --- CMakeLists.txt | 3 ++- config.h.in | 1 + src/AudioToolbox/AudioConverter.cpp | 4 ++-- src/CoreServices/Components.cpp | 7 ++++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8196877c..ad5d2b96c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/util) include_directories(${CMAKE_BINARY_DIR}) # for config.h set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") -configure_file(config.h.in config.h) ###################### # iOS build # @@ -142,6 +141,7 @@ add_subdirectory(src/Carbon) add_subdirectory(src/SystemConfiguration) if (WITH_COREAUDIO) + set(FRAMEWORK_COREAUDIO TRUE) add_subdirectory(src/AudioUnit) add_subdirectory(src/AudioToolbox) endif (WITH_COREAUDIO) @@ -158,3 +158,4 @@ add_dependencies(Cocoa crashhandler) endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm.*") +configure_file(config.h.in config.h) diff --git a/config.h.in b/config.h.in index e7916ad62..3c92bb384 100644 --- a/config.h.in +++ b/config.h.in @@ -9,6 +9,7 @@ #define ETC_DARLING_PATH "/etc/darling" #cmakedefine MULTILIB +#cmakedefine FRAMEWORK_COREAUDIO /* * Credit: diff --git a/src/AudioToolbox/AudioConverter.cpp b/src/AudioToolbox/AudioConverter.cpp index 3945422ec..63b036873 100644 --- a/src/AudioToolbox/AudioConverter.cpp +++ b/src/AudioToolbox/AudioConverter.cpp @@ -232,7 +232,7 @@ enum AVCodecID AudioConverter::CACodecToAV(const AudioStreamBasicDescription* de } if (desc->mBitsPerChannel != 8 && desc->mFormatFlags & kAudioFormatFlagIsBigEndian) - cid++; + cid = (enum AVCodecID)(int(cid)+1); return cid; } else @@ -249,7 +249,7 @@ enum AVCodecID AudioConverter::CACodecToAV(const AudioStreamBasicDescription* de } if (desc->mBitsPerChannel != 8 && desc->mFormatFlags & kAudioFormatFlagIsBigEndian) - cid++; + cid = (enum AVCodecID)(int(cid)+1); return cid; } return AV_CODEC_ID_NONE; diff --git a/src/CoreServices/Components.cpp b/src/CoreServices/Components.cpp index 4d8f619aa..a9396688f 100644 --- a/src/CoreServices/Components.cpp +++ b/src/CoreServices/Components.cpp @@ -1,3 +1,4 @@ +#include "config.h" #include "Components.h" #include "ComponentsInternal.h" #include "frameworks.h" @@ -9,7 +10,7 @@ Component FindNextComponent(Component prev, ComponentDescription* desc) { TRACE2(prev, desc); -#ifdef FRAMERWORK_COREAUDIO +#ifdef FRAMEWORK_COREAUDIO if ((desc->componentType & 0xffff0000) == kComponentTypeAudioUnit) { return AudioComponentFindNext((AudioComponent) prev, (AudioComponentDescription*) desc); @@ -21,7 +22,7 @@ Component FindNextComponent(Component prev, ComponentDescription* desc) long CountComponents(ComponentDescription* desc) { -#ifdef FRAMERWORK_COREAUDIO +#ifdef FRAMEWORK_COREAUDIO if ((desc->componentType & 0xffff0000) == kComponentTypeAudioUnit) { return AudioComponentCount((AudioComponentDescription*) desc); @@ -40,7 +41,7 @@ OSErr OpenAComponent(Component comp, ComponentInstance* out) *out = nullptr; -#ifdef FRAMERWORK_COREAUDIO +#ifdef FRAMEWORK_COREAUDIO if (GetComponentType(comp) == kComponentTypeAudioUnit) { AudioComponentInstance inst;