summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2020-03-19 00:13:51 -0700
committerJan Ekström <jeebjp@gmail.com>2020-03-19 20:39:44 +0200
commit609d0ef478340207be3ed880aa3f56c3bbce1803 (patch)
tree4c2735ea72958161ba8f870681082dee509cd2e5 /audio/out
parent433c9a90a5b89151217cbe5c596f4fad6580d704 (diff)
downloadmpv-609d0ef478340207be3ed880aa3f56c3bbce1803.tar.bz2
mpv-609d0ef478340207be3ed880aa3f56c3bbce1803.tar.xz
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.
Diffstat (limited to 'audio/out')
-rw-r--r--audio/out/ao_wasapi_utils.c5
1 files 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)
{