mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-15 06:16:00 +00:00
Revert "audio: Device threads don't increment physical device refcounts."
This reverts commit 76f81797b7
.
This worked in the normal cases, but:
A device thread that calls SDL_DisconnectAudioDevice due to failure will fire
the disconnect event from the device thread...and if there's an event watcher
that uses that moment to close the device, we still end up in the same
situation, where the device thread tries to join on itself.
Better solutions are still pending.
This commit is contained in:
@@ -111,6 +111,8 @@ static int HAIKUAUDIO_OpenDevice(SDL_AudioDevice *device)
|
||||
}
|
||||
SDL_zerop(device->hidden);
|
||||
|
||||
RefPhysicalAudioDevice(device); // CloseDevice will always unref this through SDL_AudioThreadFinalize, even if we failed to start the thread.
|
||||
|
||||
// Parse the audio format and fill the Be raw audio format
|
||||
media_raw_audio_format format;
|
||||
SDL_zero(format);
|
||||
|
Reference in New Issue
Block a user