From 2f2b27164906d25949c3db504d3f312118c1c431 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 5 Mar 2009 22:07:06 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28828 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_win32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libao2/ao_win32.c b/libao2/ao_win32.c index 11883a92e4..93622b944b 100644 --- a/libao2/ao_win32.c +++ b/libao2/ao_win32.c @@ -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);