Skip to content

Commit

Permalink
Fixing AudioToolbox build troubles
Browse files Browse the repository at this point in the history
  • Loading branch information
LubosD committed Feb 28, 2014
1 parent d117b0c commit f6451bf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
Expand Down Expand Up @@ -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)
Expand All @@ -158,3 +158,4 @@ add_dependencies(Cocoa crashhandler)

endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm.*")

configure_file(config.h.in config.h)
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define ETC_DARLING_PATH "/etc/darling"

#cmakedefine MULTILIB
#cmakedefine FRAMEWORK_COREAUDIO

/*
* Credit:
Expand Down
4 changes: 2 additions & 2 deletions src/AudioToolbox/AudioConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions src/CoreServices/Components.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
#include "Components.h"
#include "ComponentsInternal.h"
#include "frameworks.h"
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -40,7 +41,7 @@ OSErr OpenAComponent(Component comp, ComponentInstance* out)

*out = nullptr;

#ifdef FRAMERWORK_COREAUDIO
#ifdef FRAMEWORK_COREAUDIO
if (GetComponentType(comp) == kComponentTypeAudioUnit)
{
AudioComponentInstance inst;
Expand Down

0 comments on commit f6451bf

Please sign in to comment.