From 678948068bbde7f12a9c5f28a467b6cf4d127851 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 1 Aug 2014 22:10:38 -0300 Subject: 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 --- platform/iphone/audio_driver_iphone.cpp | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'platform/iphone/audio_driver_iphone.cpp') 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() { + +}; -- cgit v1.2.3