diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-10-22 04:31:36 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-10-26 16:49:38 +0000 |
commit | 34d99840a5cee8907cf4b2528efb1670a8f51744 (patch) | |
tree | 4b1f1847c9f81eb650d29cb519a44ed5d3d9e404 /osdep/timer-linux.c | |
parent | 032b7de97f1c8c28358a96e9ecfac87d6621a4fb (diff) | |
download | mpv-34d99840a5cee8907cf4b2528efb1670a8f51744.tar.bz2 mpv-34d99840a5cee8907cf4b2528efb1670a8f51744.tar.xz |
timer: use MP_TIME macros
Diffstat (limited to 'osdep/timer-linux.c')
-rw-r--r-- | osdep/timer-linux.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/osdep/timer-linux.c b/osdep/timer-linux.c index ff4b137cb2..25bb70bcca 100644 --- a/osdep/timer-linux.c +++ b/osdep/timer-linux.c @@ -27,8 +27,8 @@ void mp_sleep_ns(int64_t ns) if (ns < 0) return; struct timespec ts; - ts.tv_sec = ns / UINT64_C(1000000000); - ts.tv_nsec = ns % UINT64_C(1000000000); + ts.tv_sec = ns / MP_TIME_S_TO_NS(1); + ts.tv_nsec = ns % MP_TIME_S_TO_NS(1); nanosleep(&ts, NULL); } @@ -40,7 +40,7 @@ uint64_t mp_raw_time_ns(void) #else timespec_get(&tp, TIME_UTC); #endif - return tp.tv_sec * UINT64_C(1000000000) + tp.tv_nsec; + return MP_TIME_S_TO_NS(tp.tv_sec) + tp.tv_nsec; } void mp_raw_time_init(void) |