From d52df30c881db4dfee86d183703606e8ed078c4c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 11 Feb 2020 13:08:04 +0100 Subject: [PATCH] pipewireclock: use the monotonic time for now Don't try to use the ticks for the clock but use the monotonic timestamp instead. --- src/gst/gstpipewireclock.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gst/gstpipewireclock.c b/src/gst/gstpipewireclock.c index 146203011..91210dfa6 100644 --- a/src/gst/gstpipewireclock.c +++ b/src/gst/gstpipewireclock.c @@ -61,8 +61,9 @@ gst_pipewire_clock_get_internal_time (GstClock * clock) t.rate.denom == 0) return pclock->last_time; - result = gst_util_uint64_scale_int (t.ticks, GST_SECOND * t.rate.num, t.rate.denom); clock_gettime(CLOCK_MONOTONIC, &ts); +#if 0 + result = gst_util_uint64_scale_int (t.ticks, GST_SECOND * t.rate.num, t.rate.denom); result += SPA_TIMESPEC_TO_NSEC(&ts) - t.now; result += pclock->time_offset; @@ -70,6 +71,11 @@ gst_pipewire_clock_get_internal_time (GstClock * clock) GST_DEBUG ("%"PRId64", %d/%d %"PRId64" %"PRId64, t.ticks, t.rate.num, t.rate.denom, t.now, result); +#else + result = SPA_TIMESPEC_TO_NSEC(&ts); + result += pclock->time_offset; + pclock->last_time = result; +#endif return result; }