[vlc-commits] win32:thread: make the delay rounding to the upper ms more explicit

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Sat May  5 10:48:11 2018 +0200| [8f0aab077ff685e88e49a6b55799c2d63b2c2050] | committer: Steve Lhomme

win32:thread: make the delay rounding to the upper ms more explicit

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

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

diff --git a/src/win32/thread.c b/src/win32/thread.c
index 95cc6f7b3d..b4bfaeb585 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -422,7 +422,7 @@ void vlc_addr_wait(void *addr, unsigned val)
 
 bool vlc_addr_timedwait(void *addr, unsigned val, vlc_tick_t delay)
 {
-    delay = (delay + 999) / 1000;
+    delay = (delay + (1000-1)) / 1000;
 
     if (delay > 0x7fffffff)
     {
@@ -784,7 +784,7 @@ void (vlc_tick_wait)(vlc_tick_t deadline)
     vlc_testcancel();
     while ((delay = (deadline - vlc_tick_now())) > 0)
     {
-        delay = (delay + 999) / 1000;
+        delay = (delay + (1000-1)) / 1000;
         if (unlikely(delay > 0x7fffffff))
             delay = 0x7fffffff;
 



More information about the vlc-commits mailing list