[vlc-commits] mmdevice: more accurate drain emulation

Thomas Guillem git at videolan.org
Sat Sep 2 17:40:38 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sat Sep  2 15:36:58 2017 +0200| [960e12d7f2ae8e7eb5fe7958bf370d1f9d8e7eec] | committer: Thomas Guillem

mmdevice: more accurate drain emulation

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=960e12d7f2ae8e7eb5fe7958bf370d1f9d8e7eec
---

 modules/audio_output/mmdevice.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/audio_output/mmdevice.h b/modules/audio_output/mmdevice.h
index 51f5e427df..6843bc95ec 100644
--- a/modules/audio_output/mmdevice.h
+++ b/modules/audio_output/mmdevice.h
@@ -78,7 +78,7 @@ static inline HRESULT aout_stream_Flush(aout_stream_t *s, bool wait)
     {   /* Loosy drain emulation */
         mtime_t delay;
 
-        if (SUCCEEDED(aout_stream_TimeGet(s, &delay)))
+        while (SUCCEEDED(aout_stream_TimeGet(s, &delay)) && delay > 0)
             Sleep((delay / (CLOCK_FREQ / 1000)) + 1);
         return S_OK;
     }



More information about the vlc-commits mailing list