diff options
author | Chris Robinson <[email protected]> | 2023-05-31 02:15:43 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-05-31 02:15:43 -0700 |
commit | 1a583b016a7b5e22f370e2f425722e3dc240a7dd (patch) | |
tree | 01febd72233b1845044c7c55ad04a4e01a614608 /alc | |
parent | 23f90b854a51eeaf6f70383beeef42944b675ce0 (diff) |
Initialize the WASAPI device helper earlier
Diffstat (limited to 'alc')
-rw-r--r-- | alc/backends/wasapi.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index a11f8ae9..ccdc54e7 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -891,8 +891,6 @@ int WasapiProxy::messageHandler(std::promise<HRESULT> *promise) promise->set_value(S_OK); promise = nullptr; - sDeviceHelper.reset(new DeviceHelper{}); - TRACE("Starting message loop\n"); while(Msg msg{popMessage()}) { @@ -2217,6 +2215,9 @@ bool WasapiBackendFactory::init() WARN("Failed to create IMMDeviceEnumerator instance: 0x%08lx\n", hr); enumerator = nullptr; #endif + if(SUCCEEDED(hr)) + WasapiProxy::sDeviceHelper.reset(new DeviceHelper{}); + CoUninitialize(); return hr; |