Prevent CoreAudio driver failing on finish if Dummy driver was selected

This commit is contained in:
Marcelo Fernandez 2018-08-25 10:42:30 -03:00
parent 12290c172a
commit 5d0622a8de

View file

@ -331,6 +331,7 @@ bool AudioDriverCoreAudio::try_lock() {
} }
void AudioDriverCoreAudio::finish() { void AudioDriverCoreAudio::finish() {
if (audio_unit) {
OSStatus result; OSStatus result;
lock(); lock();
@ -374,12 +375,13 @@ void AudioDriverCoreAudio::finish() {
} }
unlock(); unlock();
}
if (mutex) { if (mutex) {
memdelete(mutex); memdelete(mutex);
mutex = NULL; mutex = NULL;
} }
}; }
Error AudioDriverCoreAudio::capture_start() { Error AudioDriverCoreAudio::capture_start() {
@ -576,6 +578,7 @@ String AudioDriverCoreAudio::capture_get_device() {
#endif #endif
AudioDriverCoreAudio::AudioDriverCoreAudio() { AudioDriverCoreAudio::AudioDriverCoreAudio() {
audio_unit = NULL;
active = false; active = false;
mutex = NULL; mutex = NULL;