From fd55a0f1efdf8ceb8fc996cd3cfa552a0cd069af Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 8 May 2023 12:19:27 +0100 Subject: [PATCH] u/pacing: Use helpers for ms <-> ns conversion --- src/xrt/auxiliary/util/u_pacing_compositor_fake.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xrt/auxiliary/util/u_pacing_compositor_fake.c b/src/xrt/auxiliary/util/u_pacing_compositor_fake.c index d12189528..bd15ae60b 100644 --- a/src/xrt/auxiliary/util/u_pacing_compositor_fake.c +++ b/src/xrt/auxiliary/util/u_pacing_compositor_fake.c @@ -92,7 +92,7 @@ static uint64_t calc_display_time(struct fake_timing *ft, uint64_t present_time_ns) { double offset_ms = ft->present_to_display_offset_ms.val; - uint64_t offset_ns = (uint64_t)(offset_ms * (double)U_TIME_1MS_IN_NS); + uint64_t offset_ns = time_ms_f_to_ns(offset_ms); return present_time_ns + offset_ns; } @@ -234,7 +234,7 @@ pc_update_present_offset(struct u_pacing_compositor *upc, int64_t frame_id, uint // not associating with frame IDs right now. (void)frame_id; - double offset_ms = (double)present_to_display_offset_ns / (double)U_TIME_1MS_IN_NS; + double offset_ms = time_ns_to_ms_f(present_to_display_offset_ns); ft->present_to_display_offset_ms.val = offset_ms; }