audio: Split Deinitialize into two stages.

First stage happens before we destroy objects, and is generally used to
shut down hotplug. The second stage is the usual deinit, which cleans up
the lowlevel API, unloads shared libraries, etc.
This commit is contained in:
Ryan C. Gordon 2023-10-18 10:41:20 -04:00
parent e55e556f32
commit 7a52f7b3fd
No known key found for this signature in database
GPG key ID: FA148B892AB48044
12 changed files with 85 additions and 12 deletions

View file

@ -220,7 +220,7 @@ int WASAPI_PlatformInit(void)
return 0;
}
void WASAPI_PlatformDeinit(void)
static void StopWasapiHotplug(void)
{
delete playback_device_event_handler;
playback_device_event_handler = nullptr;
@ -228,6 +228,17 @@ void WASAPI_PlatformDeinit(void)
capture_device_event_handler = nullptr;
}
void WASAPI_PlatformDeinit(void)
{
StopWasapiHotplug();
}
void WASAPI_PlatformDeinitializeStart(void)
{
StopWasapiHotplug();
}
void WASAPI_EnumerateEndpoints(SDL_AudioDevice **default_output, SDL_AudioDevice **default_capture)
{
Platform::String ^ defdevid;