diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-11-02 11:31:01 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-11-02 11:31:01 -0300 |
commit | d85b67be53bac252c0a28b799d56d1b359c4ee99 (patch) | |
tree | 5227e145e3271bfee542bdd3e4237c3378565306 /platform/osx/audio_driver_osx.cpp | |
parent | 738eb2c1a88d441eacc4149ce8f1c12a90267191 (diff) |
Bug Fixes
-=-=-=-=-
-Fixed problem with scaling shapes (#827), related to not taking scale in consideration for calculating the moment of inertia
-Added support for multiline strings (or comments) using """
-Save subscene bug, properties not being saved in root node (#806)
-Fix Crash in CollisionPolygon2DEditor (#814)
-Restored Ability to compile without 3D (#795)
-Fix InterpolatedCamera (#803)
-Fix UV Import for OBJ Meshes (#771)
-Fixed issue with modifier gizmos (#794)
-Fixed CapsuleShape gizmo handle (#50)
-Fixed Import Button (not properly working in 3D) (#733)
-Many misc fixes (though no new features)
Diffstat (limited to 'platform/osx/audio_driver_osx.cpp')
-rw-r--r-- | platform/osx/audio_driver_osx.cpp | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/platform/osx/audio_driver_osx.cpp b/platform/osx/audio_driver_osx.cpp index 8f28e8ff63..638ac7e504 100644 --- a/platform/osx/audio_driver_osx.cpp +++ b/platform/osx/audio_driver_osx.cpp @@ -101,7 +101,16 @@ OSStatus AudioDriverOSX::output_callback(void *inRefCon, AudioBuffer *abuf; AudioDriverOSX* ad = (AudioDriverOSX*)inRefCon; - if (!ad->active) { + bool mix = true; + + if (!ad->active) + mix = false; + else if (ad->mutex) { + mix = ad->mutex->try_lock() == OK; + }; + + + if (!mix) { for (unsigned int i = 0; i < ioData->mNumberBuffers; i++) { abuf = &ioData->mBuffers[i]; zeromem(abuf->mData, abuf->mDataByteSize); @@ -120,9 +129,9 @@ OSStatus AudioDriverOSX::output_callback(void *inRefCon, while (frames_left) { int frames = MIN(frames_left, ad->buffer_frames); - ad->lock(); + //ad->lock(); ad->audio_server_process(frames, ad->samples_in); - ad->unlock(); + //ad->unlock(); for(int i = 0; i < frames * ad->channels; i++) { @@ -134,6 +143,9 @@ OSStatus AudioDriverOSX::output_callback(void *inRefCon, }; }; + if (ad->mutex) + ad->mutex->unlock(); + return 0; }; @@ -149,12 +161,27 @@ AudioDriverSW::OutputFormat AudioDriverOSX::get_output_format() const { return OUTPUT_STEREO; }; -void AudioDriverOSX::lock() {}; -void AudioDriverOSX::unlock() {}; +void AudioDriverOSX::lock() { + if (active && mutex) + mutex->lock(); +}; +void AudioDriverOSX::unlock() { + if (active && mutex) + mutex->unlock(); +}; void AudioDriverOSX::finish() { memdelete_arr(samples_in); }; +AudioDriverOSX::AudioDriverOSX() { + + mutex=Mutex::create();//NULL; +}; + +AudioDriverOSX::~AudioDriverOSX() { + +}; + #endif |