summaryrefslogtreecommitdiffstats
path: root/video/out/present_sync.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-09-16 04:45:24 +0200
committerDudemanguy <random342@airmail.cc>2023-09-29 20:48:58 +0000
commitdf764bc0c3926ff06902c2ed8609ed7633408550 (patch)
tree9b0332fc95ca0cbbbdc3653fbc06104b62fc4e28 /video/out/present_sync.c
parentcdfd5c280a174b9e126908305c250bedbec0be61 (diff)
downloadmpv-df764bc0c3926ff06902c2ed8609ed7633408550.tar.bz2
mpv-df764bc0c3926ff06902c2ed8609ed7633408550.tar.xz
vo: change vsync base to nanoseconds
There is no reason to use microseconds precision. We have precise timers all all relevant platforms.
Diffstat (limited to 'video/out/present_sync.c')
-rw-r--r--video/out/present_sync.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/present_sync.c b/video/out/present_sync.c
index 5c8ae42ab5..e7112ccc39 100644
--- a/video/out/present_sync.c
+++ b/video/out/present_sync.c
@@ -70,8 +70,8 @@ void present_sync_swap(struct mp_present *present)
if (clock_gettime(CLOCK_MONOTONIC, &ts))
return;
- int64_t now_monotonic = ts.tv_sec * 1000000LL + ts.tv_nsec / 1000;
- int64_t ust_mp_time = mp_time_us() - (now_monotonic - ust);
+ int64_t now_monotonic = ts.tv_sec * UINT64_C(1000000000) + ts.tv_nsec;
+ int64_t ust_mp_time = mp_time_ns() - (now_monotonic - ust);
present->last_queue_display_time = ust_mp_time;
}