[vlc-commits] win32:timer: make the value/interval rounding to the upper ms more explicit

Steve Lhomme git at videolan.org
Fri Jul 6 12:42:13 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Sat May  5 10:49:30 2018 +0200| [d614843e2c13877ab681195202b494d732789770] | committer: Steve Lhomme

win32:timer: make the value/interval rounding to the upper ms more explicit

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

 src/win32/timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/win32/timer.c b/src/win32/timer.c
index 4c118252bc..ba37d4b78f 100644
--- a/src/win32/timer.c
+++ b/src/win32/timer.c
@@ -79,8 +79,8 @@ void vlc_timer_schedule (vlc_timer_t timer, bool absolute,
         if (value < 0)
             value = 0;
     }
-    value = (value + 999) / 1000;
-    interval = (interval + 999) / 1000;
+    value = (value + (1000-1)) / 1000;
+    interval = (interval + (1000-1)) / 1000;
 
     if (!CreateTimerQueueTimer (&timer->handle, NULL, vlc_timer_do, timer,
                                 MS_FROM_VLC_TICK(value), MS_FROM_VLC_TICK(interval),



More information about the vlc-commits mailing list