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.
This commit is contained in:
Kevin Mitchell 2020-03-19 00:13:51 -07:00 committed by Jan Ekström
parent 433c9a90a5
commit 609d0ef478
1 changed files with 3 additions and 2 deletions

View File

@ -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)
{