[vlc-commits] thread: convert timeval to vlc_tick using vlc_tick_from_timeval()

Steve Lhomme git at videolan.org
Wed Jul 4 10:39:20 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul  4 10:25:04 2018 +0200| [c6b89bdc41271f5b8bacffd3a4dff3b2a65966b2] | committer: Steve Lhomme

thread: convert timeval to vlc_tick using vlc_tick_from_timeval()

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

 src/android/thread.c | 2 +-
 src/os2/thread.c     | 2 +-
 src/posix/thread.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/android/thread.c b/src/android/thread.c
index eed3c0eab9..27b5421b96 100644
--- a/src/android/thread.c
+++ b/src/android/thread.c
@@ -417,7 +417,7 @@ vlc_tick_t vlc_tick_now (void)
         abort ();
 
     static_assert(INT64_C(1000000) == CLOCK_FREQ, "CLOCK_FREQ mismatch");
-    return vlc_tick_from_sec( ts.tv_sec ) + VLC_TICK_FROM_NS( ts.tv_nsec );
+    return vlc_tick_from_timeval( &ts );
 }
 
 /* cpu */
diff --git a/src/os2/thread.c b/src/os2/thread.c
index fe88dd7088..f599a06f9e 100644
--- a/src/os2/thread.c
+++ b/src/os2/thread.c
@@ -418,7 +418,7 @@ int vlc_cond_timedwait_daytime (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
 
     gettimeofday (&tv, NULL);
 
-    total = vlc_tick_from_sec( tv.tv_sec ) + VLC_TICK_FROM_US( tv.tv_usec );
+    total = vlc_tick_from_timeval( &tv );
     total = (deadline - total) / 1000;
     if( total < 0 )
         total = 0;
diff --git a/src/posix/thread.c b/src/posix/thread.c
index 4b8069b6be..500b6bccc1 100644
--- a/src/posix/thread.c
+++ b/src/posix/thread.c
@@ -586,7 +586,7 @@ vlc_tick_t vlc_tick_now (void)
         abort ();
 
     static_assert(INT64_C(1000000) == CLOCK_FREQ, "CLOCK_FREQ mismatch");
-    return vlc_tick_from_sec( ts.tv_sec ) + VLC_TICK_FROM_NS( ts.tv_nsec );
+    return vlc_tick_from_timeval( &ts );
 }
 
 #undef vlc_tick_wait



More information about the vlc-commits mailing list