From d9a13585050172aade10e49febdd987b5ceda824 Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Fri, 19 Jul 2013 23:57:58 -0300 Subject: ao_wasapi0: Don't complain about failed init during AO probing Only if the user specifically asked for ao_wasapi0. --- audio/out/ao_wasapi0.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'audio/out/ao_wasapi0.c') diff --git a/audio/out/ao_wasapi0.c b/audio/out/ao_wasapi0.c index c08370f350..5c161cea4b 100644 --- a/audio/out/ao_wasapi0.c +++ b/audio/out/ao_wasapi0.c @@ -746,7 +746,7 @@ static int thread_init(struct ao *ao) if (*end != '\0' || devno < 0) { mp_msg(MSGT_AO, MSGL_ERR, "ao-wasapi: invalid device number %s!", state->opt_device); - goto exit_nolog; + goto exit_label; } } hr = find_and_load_device(state, devno, devid); @@ -775,10 +775,6 @@ static int thread_init(struct ao *ao) return state->init_ret; } exit_label: - EnterCriticalSection(&state->print_lock); - mp_msg(MSGT_AO, MSGL_ERR, "ao-wasapi: thread_init failed!\n"); - LeaveCriticalSection(&state->print_lock); -exit_nolog: state->init_ret = -1; SetEvent(state->init_done); return -1; @@ -1084,9 +1080,15 @@ static int init(struct ao *ao, char *params) return -1; } WaitForSingleObject(state->init_done, INFINITE); /* wait on init complete */ - mp_msg(MSGT_AO, MSGL_V, "ao-wasapi0: Init Done!\n"); - if (setup_buffers(state)) - mp_msg(MSGT_AO, MSGL_ERR, "ao-wasapi0: buffer setup failed!\n"); + if (state->init_ret) { + if (!ao->probing) { + mp_msg(MSGT_AO, MSGL_ERR, "ao-wasapi: thread_init failed!\n"); + } + } else { + mp_msg(MSGT_AO, MSGL_V, "ao-wasapi0: Init Done!\n"); + if (setup_buffers(state)) + mp_msg(MSGT_AO, MSGL_ERR, "ao-wasapi0: buffer setup failed!\n"); + } return state->init_ret; } -- cgit v1.2.3