From 609d0ef478340207be3ed880aa3f56c3bbce1803 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Thu, 19 Mar 2020 00:13:51 -0700 Subject: ao_wasapi: handle S_FALSE in mp_format_res_str IsFormatSupported may return S_FALSE (considered SUCCESS) if the requested format is not suppported, but is close to one that is. --- audio/out/ao_wasapi_utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index df844aad7f..485f8a53f1 100644 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -299,8 +299,9 @@ static bool set_ao_format(struct ao *ao, WAVEFORMATEX *wf, } #define mp_format_res_str(hres) \ - (SUCCEEDED(hres) ? "ok" : ((hres) == AUDCLNT_E_UNSUPPORTED_FORMAT) \ - ? "unsupported" : mp_HRESULT_to_str(hres)) + (SUCCEEDED(hres) ? ((hres) == S_OK) ? "ok" : "close" \ + : ((hres) == AUDCLNT_E_UNSUPPORTED_FORMAT) \ + ? "unsupported" : mp_HRESULT_to_str(hres)) static bool try_format_exclusive(struct ao *ao, WAVEFORMATEXTENSIBLE *wformat) { -- cgit v1.2.3