changeset 28793:afbd8dd23299

Sleep based on get_delay in ao_win32 uninit instead of a loop. The loop for an unknown reason could rarely cause an endless loop.
author reimar
date Thu, 05 Mar 2009 22:07:06 +0000
parents ca641bd35f98
children ee67a72f9dde
files libao2/ao_win32.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_win32.c	Thu Mar 05 21:27:05 2009 +0000
+++ b/libao2/ao_win32.c	Thu Mar 05 22:07:06 2009 +0000
@@ -251,7 +251,8 @@
 // close audio device
 static void uninit(int immed)
 {
-    if(!immed)while(buffered_bytes > 0)usec_sleep(50000);
+    if(!immed)
+	usec_sleep(get_delay() * 1000 * 1000);
     else buffered_bytes=0;
 	waveOutReset(hWaveOut);
 	waveOutClose(hWaveOut);