summaryrefslogtreecommitdiff
path: root/platform/android/audio_driver_opensl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/audio_driver_opensl.cpp')
-rw-r--r--platform/android/audio_driver_opensl.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/platform/android/audio_driver_opensl.cpp b/platform/android/audio_driver_opensl.cpp
index 6e9864c803..307bc3a169 100644
--- a/platform/android/audio_driver_opensl.cpp
+++ b/platform/android/audio_driver_opensl.cpp
@@ -44,8 +44,8 @@ void AudioDriverOpenSL::_buffer_callback(
if (pause) {
mix = false;
- } else if (mutex) {
- mix = mutex->try_lock() == OK;
+ } else {
+ mix = mutex.try_lock() == OK;
}
if (mix) {
@@ -58,8 +58,8 @@ void AudioDriverOpenSL::_buffer_callback(
}
}
- if (mutex && mix)
- mutex->unlock();
+ if (mix)
+ mutex.unlock();
const int32_t *src_buff = mixdown_buffer;
@@ -107,7 +107,6 @@ Error AudioDriverOpenSL::init() {
void AudioDriverOpenSL::start() {
- mutex = Mutex::create();
active = false;
SLresult res;
@@ -330,13 +329,13 @@ AudioDriver::SpeakerMode AudioDriverOpenSL::get_speaker_mode() const {
void AudioDriverOpenSL::lock() {
if (active && mutex)
- mutex->lock();
+ mutex.lock();
}
void AudioDriverOpenSL::unlock() {
if (active && mutex)
- mutex->unlock();
+ mutex.unlock();
}
void AudioDriverOpenSL::finish() {
@@ -359,7 +358,6 @@ void AudioDriverOpenSL::set_pause(bool p_pause) {
AudioDriverOpenSL::AudioDriverOpenSL() {
s_ad = this;
- mutex = Mutex::create(); //NULL;
pause = false;
active = false;
}