From 2b6b69fb127ef6fd27824b8ae988efef0f822dc1 Mon Sep 17 00:00:00 2001 From: thfrwn <11335318+rfht@users.noreply.github.com> Date: Sun, 12 Dec 2021 10:08:11 -0700 Subject: [PATCH] fix assertion failure in sndio audio caused by the recent hotplugging support --- src/audio/sndio/SDL_sndioaudio.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/audio/sndio/SDL_sndioaudio.c b/src/audio/sndio/SDL_sndioaudio.c index f925961fc..0cece8ce9 100644 --- a/src/audio/sndio/SDL_sndioaudio.c +++ b/src/audio/sndio/SDL_sndioaudio.c @@ -350,6 +350,13 @@ SNDIO_Deinitialize(void) UnloadSNDIOLibrary(); } +static void +SNDIO_DetectDevices(void) +{ + SDL_AddAudioDevice(SDL_FALSE, DEFAULT_OUTPUT_DEVNAME, NULL, (void *) 0x1); + SDL_AddAudioDevice(SDL_TRUE, DEFAULT_INPUT_DEVNAME, NULL, (void *) 0x2); +} + static int SNDIO_Init(SDL_AudioDriverImpl * impl) { @@ -366,6 +373,7 @@ SNDIO_Init(SDL_AudioDriverImpl * impl) impl->CaptureFromDevice = SNDIO_CaptureFromDevice; impl->FlushCapture = SNDIO_FlushCapture; impl->Deinitialize = SNDIO_Deinitialize; + impl->DetectDevices = SNDIO_DetectDevices; impl->AllowsArbitraryDeviceNames = 1; impl->HasCaptureSupport = SDL_TRUE;