[vlc-commits] core: rename mtime_to_ts() to timespec_from_vlc_tick()

Steve Lhomme git at videolan.org
Wed Jul 4 11:38:41 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul  4 11:22:40 2018 +0200| [2bf717fbf800bbcf9e9aff0b77600cb96f2d5ab7] | committer: Steve Lhomme

core: rename mtime_to_ts() to timespec_from_vlc_tick()

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

 include/vlc_tick.h  | 2 +-
 src/darwin/thread.c | 4 ++--
 src/linux/thread.c  | 2 +-
 src/misc/mtime.c    | 2 +-
 src/posix/thread.c  | 6 +++---
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/vlc_tick.h b/include/vlc_tick.h
index 25d070e3ea..19d835cac6 100644
--- a/include/vlc_tick.h
+++ b/include/vlc_tick.h
@@ -165,7 +165,7 @@ static inline vlc_tick_t vlc_tick_from_timeval(const struct timeval *tv)
     return vlc_tick_from_sec( tv->tv_sec ) + VLC_TICK_FROM_US( tv->tv_usec );
 }
 
-struct timespec mtime_to_ts (vlc_tick_t date);
+struct timespec timespec_from_vlc_tick(vlc_tick_t date);
 
 
 /*****************************************************************************
diff --git a/src/darwin/thread.c b/src/darwin/thread.c
index b6ac92af77..8f4bba370c 100644
--- a/src/darwin/thread.c
+++ b/src/darwin/thread.c
@@ -251,7 +251,7 @@ int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
     if (deadline < 0)
         deadline = 0;
 
-    struct timespec ts = mtime_to_ts(deadline);
+    struct timespec ts = timespec_from_vlc_tick(deadline);
     int val = pthread_cond_timedwait_relative_np(p_condvar, p_mutex, &ts);
     if (val != ETIMEDOUT)
         VLC_THREAD_ASSERT ("timed-waiting on condition");
@@ -539,7 +539,7 @@ void vlc_tick_wait (vlc_tick_t deadline)
 #undef vlc_tick_sleep
 void vlc_tick_sleep (vlc_tick_t delay)
 {
-    struct timespec ts = mtime_to_ts (delay);
+    struct timespec ts = timespec_from_vlc_tick (delay);
 
     /* nanosleep uses mach_absolute_time and mach_wait_until internally,
        but also handles kernel errors. Thus we use just this. */
diff --git a/src/linux/thread.c b/src/linux/thread.c
index f535602658..539c64f147 100644
--- a/src/linux/thread.c
+++ b/src/linux/thread.c
@@ -80,7 +80,7 @@ void vlc_addr_wait(void *addr, unsigned val)
 
 bool vlc_addr_timedwait(void *addr, unsigned val, vlc_tick_t delay)
 {
-    struct timespec ts = mtime_to_ts(delay);
+    struct timespec ts = timespec_from_vlc_tick(delay);
 
     return (vlc_futex_wait(addr, val, &ts) == 0 || errno != ETIMEDOUT);
 }
diff --git a/src/misc/mtime.c b/src/misc/mtime.c
index 5e428c4ad9..e3f87c895c 100644
--- a/src/misc/mtime.c
+++ b/src/misc/mtime.c
@@ -156,7 +156,7 @@ uint64_t NTPtime64(void)
     return t;
 }
 
-struct timespec mtime_to_ts (vlc_tick_t date)
+struct timespec timespec_from_vlc_tick (vlc_tick_t date)
 {
     lldiv_t d = lldiv (date, CLOCK_FREQ);
     struct timespec ts = { d.quot, NS_FROM_VLC_TICK( d.rem ) };
diff --git a/src/posix/thread.c b/src/posix/thread.c
index 74f7d36c3b..f3db3f063f 100644
--- a/src/posix/thread.c
+++ b/src/posix/thread.c
@@ -219,7 +219,7 @@ void vlc_cond_wait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex)
 int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
                         vlc_tick_t deadline)
 {
-    struct timespec ts = mtime_to_ts (deadline);
+    struct timespec ts = timespec_from_vlc_tick (deadline);
     int val = pthread_cond_timedwait (p_condvar, p_mutex, &ts);
     if (val != ETIMEDOUT)
         VLC_THREAD_ASSERT ("timed-waiting on condition");
@@ -590,7 +590,7 @@ void vlc_tick_wait (vlc_tick_t deadline)
     pthread_once(&vlc_clock_once, vlc_clock_setup_once);
     deadline -= vlc_clock_prec;
 
-    struct timespec ts = mtime_to_ts (deadline);
+    struct timespec ts = timespec_from_vlc_tick (deadline);
 
     while (clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, NULL) == EINTR);
 }
@@ -598,7 +598,7 @@ void vlc_tick_wait (vlc_tick_t deadline)
 #undef vlc_tick_sleep
 void vlc_tick_sleep (vlc_tick_t delay)
 {
-    struct timespec ts = mtime_to_ts (delay);
+    struct timespec ts = timespec_from_vlc_tick (delay);
 
     while (clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts) == EINTR);
 }



More information about the vlc-commits mailing list