# HG changeset patch # User reimar # Date 1236626120 0 # Node ID c3f295ceae51ad34fa92ad7d770c2522f1ed8548 # Parent 15f93fd5cd489ab6b63dfa043f3322d975fad3f6 Do not call waveOutReset in uninit if you should wait till playing finishes, and retry waveOutClose if it fails due to still playing. diff -r 15f93fd5cd48 -r c3f295ceae51 libao2/ao_win32.c --- a/libao2/ao_win32.c Mon Mar 09 18:21:47 2009 +0000 +++ b/libao2/ao_win32.c Mon Mar 09 19:15:20 2009 +0000 @@ -243,8 +243,9 @@ { 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");