fix assertion failure in sndio audio caused by the recent hotplugging support

This commit is contained in:
thfrwn 2021-12-12 10:08:11 -07:00 committed by Sam Lantinga
parent 8927d73b1c
commit 2b6b69fb12
1 changed files with 8 additions and 0 deletions

View File

@ -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;