diff options
Diffstat (limited to 'video')
-rw-r--r-- | video/out/drm_common.c | 2 | ||||
-rw-r--r-- | video/out/present_sync.c | 2 | ||||
-rw-r--r-- | video/out/wayland_common.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/video/out/drm_common.c b/video/out/drm_common.c index d3cb58e8a6..67cac7a908 100644 --- a/video/out/drm_common.c +++ b/video/out/drm_common.c @@ -946,7 +946,7 @@ static void drm_pflip_cb(int fd, unsigned int msc, unsigned int sec, struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) goto fail; - int64_t now_monotonic = ts.tv_sec * UINT64_C(1000000000) + ts.tv_nsec; + int64_t now_monotonic = MP_TIME_S_TO_NS(ts.tv_sec) + ts.tv_nsec; int64_t ust_mp_time = mp_time_ns() - (now_monotonic - vsync->ust * 1000); const uint64_t ust_since_enqueue = vsync->ust - frame_vsync->ust; diff --git a/video/out/present_sync.c b/video/out/present_sync.c index e7112ccc39..618c53e6a2 100644 --- a/video/out/present_sync.c +++ b/video/out/present_sync.c @@ -70,7 +70,7 @@ void present_sync_swap(struct mp_present *present) if (clock_gettime(CLOCK_MONOTONIC, &ts)) return; - int64_t now_monotonic = ts.tv_sec * UINT64_C(1000000000) + ts.tv_nsec; + int64_t now_monotonic = MP_TIME_S_TO_NS(ts.tv_sec) + ts.tv_nsec; int64_t ust_mp_time = mp_time_ns() - (now_monotonic - ust); present->last_queue_display_time = ust_mp_time; diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index d5ab2fe1c9..144ff78284 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1157,7 +1157,7 @@ static void feedback_presented(void *data, struct wp_presentation_feedback *fbac // - these values are updated every time the compositor receives feedback. int64_t sec = (uint64_t) tv_sec_lo + ((uint64_t) tv_sec_hi << 32); - int64_t ust = sec * UINT64_C(1000000000) + (uint64_t) tv_nsec; + int64_t ust = MP_TIME_S_TO_NS(sec) + (uint64_t) tv_nsec; int64_t msc = (uint64_t) seq_lo + ((uint64_t) seq_hi << 32); present_update_sync_values(wl->present, ust, msc); } |