mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-09 03:16:26 +00:00
audio: Another attempt to make device add/remove work vs event watchers.
This patch reverts the previous reversion, and then adds code to queue up events to be sent the next time SDL pumps the event queue. This guarantees that the event watcher/filter _never_ runs from an SDL audio device thread or some other backend-specific internal thread.
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