Merge pull request #12541 from unknownbrackets/sdl-minor

SDL: Ignore audio switch events in first second
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2020-01-01 17:43:34 +01:00
commit b2dd3c7e18
1 file changed
+3 -1
+3 -1
View File
@@ -910,7 +910,9 @@ int main(int argc, char *argv[]) {
if (!name) {
break;
}
if (g_Config.bAutoAudioDevice || g_Config.sAudioDevice == name) {
// Don't start auto switching for a second, because some devices init on start.
bool doAutoSwitch = g_Config.bAutoAudioDevice && framecount > 60;
if (doAutoSwitch || g_Config.sAudioDevice == name) {
StopSDLAudioDevice();
InitSDLAudioDevice(name ? name : "");
}