From 2c64a71a2928bed7b57ab98d6f3130354bab61ae Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 19:15:20 +0000 Subject: Do not call waveOutReset in uninit if you should wait till playing finishes, and retry waveOutClose if it fails due to still playing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28918 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_win32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libao2') diff --git a/libao2/ao_win32.c b/libao2/ao_win32.c index c29e05935f..b2ba0fc573 100644 --- a/libao2/ao_win32.c +++ b/libao2/ao_win32.c @@ -243,8 +243,9 @@ static void uninit(int immed) { if(!immed) usec_sleep(get_delay() * 1000 * 1000); + else waveOutReset(hWaveOut); - waveOutClose(hWaveOut); + while (waveOutClose(hWaveOut) == WAVERR_STILLPLAYING) usec_sleep(0); mp_msg(MSGT_AO, MSGL_V,"waveOut device closed\n"); free(waveBlocks); mp_msg(MSGT_AO, MSGL_V,"buffer memory freed\n"); -- cgit v1.2.3