/* Getting here means we failed the reroute attempt. Sleep for a bit and retry. */
ma_sleep(retryDelayInMilliseconds);
}
if (iRetry == retryCount) {
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to reroute device after AUDCLNT_E_DEVICE_INVALIDATED. Aborting.");
result = MA_ERROR;
break;
}
} else {
/* The device has been invalidated, but we're using a specific device. We'll just need to abort. */
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[WASAPI] The playback device has been invalidated (AUDCLNT_E_DEVICE_INVALIDATED). Aborting.");
result = MA_ERROR;
break;
}
} else {
} else {
/* Some error occurred. We'll need to abort. */
/* Some error occurred. We'll need to abort. */
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve internal buffer from playback device in preparation for writing to the device. HRESULT = %d. Stopping device.\n", (int)hr);
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to retrieve internal buffer from playback device in preparation for writing to the device. HRESULT = %d. Stopping device.\n", (int)hr);