From bee602da8287ba1ccf80a44f7c826429927bfc54 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Wed, 12 Jul 2017 23:37:45 -0700 Subject: ao_wasapi: return bool instead of HRESULT from thread_init Any bad HRESULTs should have been printed already and lots of failure modes don't have an HRESULT leading to awkward hr = E_FAIL business. This also checks the exit status of GetBufferSize in the align hack. A final fatal message is added if either of the retry hacks fail. --- audio/out/ao_wasapi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'audio/out/ao_wasapi.h') diff --git a/audio/out/ao_wasapi.h b/audio/out/ao_wasapi.h index 81c3d93386..82fa4eb419 100644 --- a/audio/out/ao_wasapi.h +++ b/audio/out/ao_wasapi.h @@ -64,8 +64,8 @@ enum wasapi_thread_state { typedef struct wasapi_state { struct mp_log *log; + bool init_ok; // status of init phase // Thread handles - HRESULT init_ret; // status of init phase HANDLE hInitDone; // set when init is complete in audio thread HANDLE hAudioThread; // the audio thread itself HANDLE hWake; // thread wakeup event @@ -114,7 +114,7 @@ bstr wasapi_get_specified_device_string(struct ao *ao); LPWSTR wasapi_find_deviceID(struct ao *ao); void wasapi_dispatch(struct ao *ao); -HRESULT wasapi_thread_init(struct ao *ao); +bool wasapi_thread_init(struct ao *ao); void wasapi_thread_uninit(struct ao *ao); void wasapi_receive_proxies(wasapi_state *state); -- cgit v1.2.3