diff --git a/CMakeLists.txt b/CMakeLists.txt index a263fd4..6134c5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,16 @@ set(CMAKE_MODULE_PATH ${LIBNYQUIST_ROOT}/cmake) include(CXXhelpers) -option(BUILD_EXAMPLE "Build example application" ON) +if (CMAKE_OSX_ARCHITECTURES) + if(CMAKE_OSX_SYSROOT MATCHES ".*iphoneos.*") + # RtAudio is not portable to ios currently + option(BUILD_EXAMPLE "Build example application" OFF) + else() + option(BUILD_EXAMPLE "Build example application" ON) + endif() +else() + option(BUILD_EXAMPLE "Build example application" ON) +endif() #------------------------------------------------------------------------------- diff --git a/third_party/opus/celt/celt_decoder.c b/third_party/opus/celt/celt_decoder.c index 830398e..7fc7961 100644 --- a/third_party/opus/celt/celt_decoder.c +++ b/third_party/opus/celt/celt_decoder.c @@ -96,12 +96,6 @@ struct OpusCustomDecoder { /* opus_val16 backgroundLogE[], Size = 2*mode->nbEBands */ }; -int celt_decoder_get_size(int channels) -{ - const CELTMode *mode = opus_custom_mode_create(48000, 960, NULL); - return opus_custom_decoder_get_size(mode, channels); -} - OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_get_size(const CELTMode *mode, int channels) { int size = sizeof(struct CELTDecoder) @@ -111,6 +105,12 @@ OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_get_size(const CELTMode *mode, int return size; } +int celt_decoder_get_size(int channels) +{ + const CELTMode *mode = opus_custom_mode_create(48000, 960, NULL); + return opus_custom_decoder_get_size(mode, channels); +} + #ifdef CUSTOM_MODES CELTDecoder *opus_custom_decoder_create(const CELTMode *mode, int channels, int *error) { @@ -128,18 +128,6 @@ CELTDecoder *opus_custom_decoder_create(const CELTMode *mode, int channels, int } #endif /* CUSTOM_MODES */ -int celt_decoder_init(CELTDecoder *st, opus_int32 sampling_rate, int channels) -{ - int ret; - ret = opus_custom_decoder_init(st, opus_custom_mode_create(48000, 960, NULL), channels); - if (ret != OPUS_OK) - return ret; - st->downsample = resampling_factor(sampling_rate); - if (st->downsample==0) - return OPUS_BAD_ARG; - else - return OPUS_OK; -} OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_init(CELTDecoder *st, const CELTMode *mode, int channels) { @@ -168,6 +156,20 @@ OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_init(CELTDecoder *st, const CELTMod return OPUS_OK; } + +int celt_decoder_init(CELTDecoder *st, opus_int32 sampling_rate, int channels) +{ + int ret; + ret = opus_custom_decoder_init(st, opus_custom_mode_create(48000, 960, NULL), channels); + if (ret != OPUS_OK) + return ret; + st->downsample = resampling_factor(sampling_rate); + if (st->downsample==0) + return OPUS_BAD_ARG; + else + return OPUS_OK; +} + #ifdef CUSTOM_MODES void opus_custom_decoder_destroy(CELTDecoder *st) { diff --git a/third_party/opus/celt/celt_encoder.c b/third_party/opus/celt/celt_encoder.c index ffff077..f4525c1 100644 --- a/third_party/opus/celt/celt_encoder.c +++ b/third_party/opus/celt/celt_encoder.c @@ -126,12 +126,6 @@ struct OpusCustomEncoder { /* opus_val16 oldLogE2[], Size = channels*mode->nbEBands */ }; -int celt_encoder_get_size(int channels) -{ - CELTMode *mode = opus_custom_mode_create(48000, 960, NULL); - return opus_custom_encoder_get_size(mode, channels); -} - OPUS_CUSTOM_NOSTATIC int opus_custom_encoder_get_size(const CELTMode *mode, int channels) { int size = sizeof(struct CELTEncoder) @@ -143,6 +137,12 @@ OPUS_CUSTOM_NOSTATIC int opus_custom_encoder_get_size(const CELTMode *mode, int return size; } +int celt_encoder_get_size(int channels) +{ + CELTMode *mode = opus_custom_mode_create(48000, 960, NULL); + return opus_custom_encoder_get_size(mode, channels); +} + #ifdef CUSTOM_MODES CELTEncoder *opus_custom_encoder_create(const CELTMode *mode, int channels, int *error) {