aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-05-17 13:02:00 -0700
committerChris Robinson <[email protected]>2022-05-17 13:02:00 -0700
commit54d72d17ad64809aeaf7a840447e398b2d38cbc9 (patch)
treea3fcd4ef8e04b944b7284f70974682fc383e56e2
parentc7c40b2606c8d513c71685ff2e4cf8e8d4c25fe3 (diff)
Use the mix format if IsFormatSupported fails for WASAPI capture
-rw-r--r--alc/backends/wasapi.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp
index 4e0f67a2..913e83ea 100644
--- a/alc/backends/wasapi.cpp
+++ b/alc/backends/wasapi.cpp
@@ -1515,10 +1515,15 @@ HRESULT WasapiCapture::resetProxy()
InputType.Format.cbSize = sizeof(InputType) - sizeof(InputType.Format);
TraceFormat("Requesting capture format", &InputType.Format);
- WAVEFORMATEX *wfx;
+ WAVEFORMATEX *wfx{};
hr = mClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &InputType.Format, &wfx);
if(FAILED(hr))
{
+ WARN("Failed to check format support: 0x%08lx\n", hr);
+ hr = mClient->GetMixFormat(&wfx);
+ }
+ if(FAILED(hr))
+ {
ERR("Failed to check format support: 0x%08lx\n", hr);
return hr;
}