aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl
diff options
context:
space:
mode:
authorNadia Holmquist Pedersen <nadia@nhp.sh>2023-07-14 02:10:04 +0200
committerNadia Holmquist Pedersen <nadia@nhp.sh>2023-07-14 02:32:09 +0200
commitca5e8792c826774d7769ab18de4bc5186134545f (patch)
tree066ebe155afb94f8b69019f1020b3d051fb1b99b /src/frontend/qt_sdl
parent0947e941b83b23b701edb31345c119f14e5ad56f (diff)
Don't try to open the mic device every time if SDL says it has none
Fixes the UI hanging up on Windows 11 when there are no mics, but the mic input is set to external device as it is by default.
Diffstat (limited to 'src/frontend/qt_sdl')
-rw-r--r--src/frontend/qt_sdl/AudioInOut.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/frontend/qt_sdl/AudioInOut.cpp b/src/frontend/qt_sdl/AudioInOut.cpp
index 395dcf8..d44e92d 100644
--- a/src/frontend/qt_sdl/AudioInOut.cpp
+++ b/src/frontend/qt_sdl/AudioInOut.cpp
@@ -126,6 +126,10 @@ void MicOpen()
return;
}
+ int numMics = SDL_GetNumAudioDevices(1);
+ if (numMics == 0)
+ return;
+
SDL_AudioSpec whatIwant, whatIget;
memset(&whatIwant, 0, sizeof(SDL_AudioSpec));
whatIwant.freq = 44100;