mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 09:26:25 +00:00
audio: Device threads don't increment physical device refcounts.
Otherwise, they risk the device thread joining on itself. Now we make sure the reference is held at the logical device level until the physical device is closed, so it can't destroy the device in normal usage until the thread is joined, etc.
This commit is contained in:
@@ -181,8 +181,6 @@ static int EMSCRIPTENAUDIO_OpenDevice(SDL_AudioDevice *device)
|
||||
return SDL_OutOfMemory();
|
||||
}
|
||||
|
||||
RefPhysicalAudioDevice(device); // CloseDevice will always unref this through SDL_AudioThreadFinalize, even if we failed to start the thread.
|
||||
|
||||
// limit to native freq
|
||||
device->spec.freq = EM_ASM_INT({ return Module['SDL3'].audioContext.sampleRate; });
|
||||
|
||||
|
Reference in New Issue
Block a user