Sleep based on get_delay in ao_win32 uninit instead of a loop.
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Thu, 5 Mar 2009 22:07:06 +0000 (22:07 +0000)
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Thu, 5 Mar 2009 22:07:06 +0000 (22:07 +0000)
The loop for an unknown reason could rarely cause an endless loop.

git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@28828 b3059339-0415-0410-9bf9-f77b7e298cf2

libao2/ao_win32.c

index 11883a9..93622b9 100644 (file)
@@ -251,7 +251,8 @@ static int init(int rate,int channels,int format,int flags)
 // 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);