sdl2_frt/src/audio/wasapi
Sam Lantinga 8a37848de9 Fixed bug 4605 - WASAPI_WaitDevice hang
Matt Brocklehurst

We've noticed that if you are playing audio on Windows via the WASAPI interface and you unplug and reconnect the device a few times the program hangs.

We've debugged the problem down to

static void
WASAPI_WaitDevice(_THIS)
{

   ... snip ...
 if (WaitForSingleObjectEx(this->hidden->event, INFINITE, FALSE) == WAIT_OBJECT_0) {
   ... snip ...
}

This WaitForSingleObjectEx does not havbe a time out defined, so it hangs there forever.

Our suggested fix we found was to include a time out of say 200mSec

We have done quite a bit of testing with this fix in place on various hardware configurations and it seems to have resolved the issue.
2019-06-08 13:41:46 -07:00
..
SDL_wasapi_win32.c Updated copyright for 2019 2019-01-04 22:01:14 -08:00
SDL_wasapi_winrt.cpp Updated copyright for 2019 2019-01-04 22:01:14 -08:00
SDL_wasapi.c Fixed bug 4605 - WASAPI_WaitDevice hang 2019-06-08 13:41:46 -07:00
SDL_wasapi.h Updated copyright for 2019 2019-01-04 22:01:14 -08:00