[vlc-commits] directsound: don't use ticksleep uninitialized

Steve Lhomme git at videolan.org
Wed Sep 19 12:15:02 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Sep 19 12:13:26 2018 +0200| [a712a7c98341fab2baa37712ee08dc9442b782d1] | committer: Steve Lhomme

directsound: don't use ticksleep uninitialized

Following 60fb9f2b9a1a2fdd783a1d146f611d9cb5ed42d8
Init to 20ms since 0 will be transformed into 20ms anyway.

We're waiting at least 20ms even when the buffer allows less to write, we
may not max out the value anymore.

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

 modules/audio_output/directsound.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/audio_output/directsound.c b/modules/audio_output/directsound.c
index d6d1e126a5..262e070ffc 100644
--- a/modules/audio_output/directsound.c
+++ b/modules/audio_output/directsound.c
@@ -1130,6 +1130,7 @@ static void * PlayedDataEraser( void * data )
 
         toerase = 0;
         tosleep = 0;
+        ticksleep = VLC_TICK_FROM_MS(20);
 
         dsresult = IDirectSoundBuffer_GetCurrentPosition( p_sys->p_dsbuffer,
                                                           &i_read, NULL );



More information about the vlc-commits mailing list