diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-08-01 22:10:38 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-08-01 22:10:38 -0300 |
commit | 678948068bbde7f12a9c5f28a467b6cf4d127851 (patch) | |
tree | 75572f3a5cc6089a6ca3046e9307d0a7c0b72c51 /platform/iphone/audio_driver_iphone.cpp | |
parent | 9ff6d55822647c87eef392147ea15641d0922d47 (diff) |
Small Issues & Maintenance
-=-=-=-=-=-=-=-=-=-=-=-=-=
-Begin work on Navigation Meshes (simple pathfinding for now, will improve soon)
-More doc on theme overriding
-Upgraded OpenSSL to version without bugs
-Misc bugfixes
Diffstat (limited to 'platform/iphone/audio_driver_iphone.cpp')
-rw-r--r-- | platform/iphone/audio_driver_iphone.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/platform/iphone/audio_driver_iphone.cpp b/platform/iphone/audio_driver_iphone.cpp index d39b8f3c4d..611f57dea3 100644 --- a/platform/iphone/audio_driver_iphone.cpp +++ b/platform/iphone/audio_driver_iphone.cpp @@ -99,7 +99,16 @@ OSStatus AudioDriverIphone::output_callback(void *inRefCon, AudioBuffer *abuf; AudioDriverIphone* ad = (AudioDriverIphone*)inRefCon; - if (!ad->active) { + bool mix = true; + + if (!ad_active) + mix = false; + else { + mix = mutex->try_lock() == OK; + }; + + + if (!mix) { for (unsigned int i = 0; i < ioData->mNumberBuffers; i++) { abuf = &ioData->mBuffers[i]; zeromem(abuf->mData, abuf->mDataByteSize); @@ -147,11 +156,28 @@ AudioDriverSW::OutputFormat AudioDriverIphone::get_output_format() const { return OUTPUT_STEREO; }; -void AudioDriverIphone::lock() {}; -void AudioDriverIphone::unlock() {}; +void AudioDriverIphone::lock() { + + if (active && mutex) + mutex->lock(); +}; + +void AudioDriverIphone::unlock() { + if (active && mutex) + mutex->unlock(); +}; void AudioDriverIphone::finish() { memdelete_arr(samples_in); }; + +AudioDriverIphone::AudioDriverIphone() { + + mutex=Mutex::create();//NULL; +}; + +AudioDriverIphone::~AudioDriverIphone() { + +}; |