Audaspace: port CoreAudio closing fix from main.
This commit is contained in:
committed by
Joerg Mueller
parent
0a16ba9911
commit
41cbebe6d9
@@ -147,9 +147,13 @@ void CoreAudioDevice::open()
|
||||
|
||||
void CoreAudioDevice::close()
|
||||
{
|
||||
AudioOutputUnitStop(m_audio_unit);
|
||||
AudioUnitUninitialize(m_audio_unit);
|
||||
AudioComponentInstanceDispose(m_audio_unit);
|
||||
// NOTE: Keep the device open for buggy MacOS versions (see blender issue #121911).
|
||||
if(__builtin_available(macOS 15.2, *))
|
||||
{
|
||||
AudioOutputUnitStop(m_audio_unit);
|
||||
AudioUnitUninitialize(m_audio_unit);
|
||||
AudioComponentInstanceDispose(m_audio_unit);
|
||||
}
|
||||
}
|
||||
|
||||
CoreAudioDevice::CoreAudioDevice(DeviceSpecs specs, int buffersize) :
|
||||
@@ -165,8 +169,7 @@ m_audio_unit(nullptr)
|
||||
|
||||
m_specs = specs;
|
||||
open();
|
||||
// NOTE: Keep the device open until #121911 is investigated/resolved from Apple side.
|
||||
// close();
|
||||
close();
|
||||
create();
|
||||
}
|
||||
|
||||
|
||||
@@ -71,9 +71,8 @@ void OpenCloseDevice::playing(bool playing)
|
||||
if(m_delayed_close_thread.joinable())
|
||||
m_delayed_close_thread.join();
|
||||
|
||||
// NOTE: Disabled until #121911 is investigated/resolved from Apple side.
|
||||
// m_delayed_close_running = true;
|
||||
// m_delayed_close_thread = std::thread(&OpenCloseDevice::closeAfterDelay, this);
|
||||
m_delayed_close_running = true;
|
||||
m_delayed_close_thread = std::thread(&OpenCloseDevice::closeAfterDelay, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user