pipewireclock: use the monotonic time for now

Don't try to use the ticks for the clock but use the monotonic
timestamp instead.
This commit is contained in:
Wim Taymans 2020-02-11 13:08:04 +01:00
parent b7f249c389
commit d52df30c88

View file

@ -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;
}