Commit 169a75e1 authored by David Reid's avatar David Reid

WASAPI: Abandon rerouting when the device is in the middle of starting.

parent 0f392b8b
......@@ -20425,7 +20425,6 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDefaultDeviceChanged
/*
Second attempt at device rerouting. We're going to retrieve the device's state at the time of
the route change. We're then going to stop the device, reinitialize the device, and then start
......@@ -20435,6 +20434,11 @@ static HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDefaultDeviceChanged
ma_uint32 previousState = ma_device_get_state(pThis->pDevice);
ma_bool8 restartDevice = MA_FALSE;
if (previousState == ma_device_state_starting) {
ma_log_postf(ma_device_get_log(pThis->pDevice), MA_LOG_LEVEL_DEBUG, "[WASAPI] Stream rerouting abandoned because the device is in the process of starting.\n");
return S_OK;
}
if (previousState == ma_device_state_started) {
ma_device_stop(pThis->pDevice);
restartDevice = MA_TRUE;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment