Check for input devices before opening them

This commit is contained in:
Eidolon 2025-01-20 22:00:14 -06:00
parent 3a23f49024
commit 1cc261e902

View file

@ -992,6 +992,11 @@ boolean I_SoundInputSetEnabled(boolean enabled)
{ {
if (g_input_device_id == 0 && enabled) if (g_input_device_id == 0 && enabled)
{ {
if (SDL_GetNumAudioDevices(true) == 0)
{
return false;
}
SDL_AudioSpec input_desired {}; SDL_AudioSpec input_desired {};
input_desired.format = AUDIO_F32SYS; input_desired.format = AUDIO_F32SYS;
input_desired.channels = 1; input_desired.channels = 1;