diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2014-11-27 18:44:06 -0800 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-01-25 17:00:10 +0900 |
commit | 1936cfdb09ed23917bf1034374caefc8d1cd0575 (patch) | |
tree | 9057d707d3b7979efcacd633372347a6a9adf736 /audio/out/ao_wasapi_utils.c | |
parent | 84c2dc882db765ffc01011f98bce2ef5026898cf (diff) | |
download | mpv-1936cfdb09ed23917bf1034374caefc8d1cd0575.tar.bz2 mpv-1936cfdb09ed23917bf1034374caefc8d1cd0575.tar.xz |
ao/wasapi: fix unmatched CoUninitialize() on init failure
Diffstat (limited to 'audio/out/ao_wasapi_utils.c')
-rwxr-xr-x | audio/out/ao_wasapi_utils.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index 71b8b20e1f..40829c6f9e 100755 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -733,20 +733,16 @@ int wasapi_enumerate_devices(struct mp_log *log, struct ao *ao, struct ao_device_list *list) { HRESULT hr; - CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); - hr = enumerate_with_state(log, ao, list, "Active devices:", DEVICE_STATE_ACTIVE, 1); EXIT_ON_ERROR(hr); hr = enumerate_with_state(log, ao, list, "Unplugged devices:", DEVICE_STATE_UNPLUGGED, 0); EXIT_ON_ERROR(hr); - CoUninitialize(); return 0; exit_label: mp_err(log, "Error enumerating devices: %s (0x%"PRIx32")\n", wasapi_explain_err(hr), (uint32_t)hr); - CoUninitialize(); return 1; } @@ -904,8 +900,6 @@ int wasapi_validate_device(struct mp_log *log, const m_option_t *opt, HRESULT wasapi_setup_proxies(struct wasapi_state *state) { HRESULT hr; - CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); - #define UNMARSHAL(type, to, from) do { \ hr = CoGetInterfaceAndReleaseStream((from), &(type), (void**) &(to)); \ (from) = NULL; \ @@ -931,8 +925,6 @@ void wasapi_release_proxies(wasapi_state *state) { SAFE_RELEASE(state->pAudioVolumeProxy, IUnknown_Release(state->pAudioVolumeProxy)); SAFE_RELEASE(state->pEndpointVolumeProxy, IUnknown_Release(state->pEndpointVolumeProxy)); SAFE_RELEASE(state->pSessionControlProxy, IUnknown_Release(state->pSessionControlProxy)); - - CoUninitialize(); } static HRESULT create_proxies(struct wasapi_state *state) { |