summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2021-04-13 11:52:06 +0200
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-04-13 12:24:02 +0000
commit93e6261db7a43b5ad50aade1742d3824e79c5ef1 (patch)
tree39996eaa292f2a1c05ce93a70377df25211384e1
parentdaf4e5b4100a859dc371940c8ff6b9ffa9da3649 (diff)
downloadgstreamer-93e6261db7a43b5ad50aade1742d3824e79c5ef1.tar.gz
systemclock: Update monotonic reference time when re-scheduling
There is no guarantee that the clock is currently advancing, therefore if we re-schedule (because of timeouts) a clock wait, we need to re-acquire the current monotonic clock value against which we will wait. Avoids spinning the cpu like mad (due to constant timeout) when clocks are PAUSED. Fixes #673 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/794>
-rw-r--r--gst/gstsystemclock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c
index 96341fd950..434abbe774 100644
--- a/gst/gstsystemclock.c
+++ b/gst/gstsystemclock.c
@@ -1004,6 +1004,7 @@ gst_system_clock_id_wait_jitter_unlocked (GstClock * clock,
/* reschedule if gst_cond_wait_until returned early or we have to reschedule after
* an unlock*/
+ mono_ts = g_get_monotonic_time ();
now = gst_clock_get_time (clock);
diff = GST_CLOCK_DIFF (now, entryt);