From 20b951efc133b7905508dd76d28b2fe622017279 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 24 Dec 2007 14:35:24 +0000 Subject: [PATCH] gst/gstsystemclock.c: Add some more docs to explain why a FIXME was wrongly added. Original commit message from CVS: * gst/gstsystemclock.c: (gst_system_clock_id_wait_jitter_unlocked): Add some more docs to explain why a FIXME was wrongly added. --- ChangeLog | 5 +++++ gst/gstsystemclock.c | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 791bdd42ae..3f245dd17c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-12-24 Wim Taymans + + * gst/gstsystemclock.c: (gst_system_clock_id_wait_jitter_unlocked): + Add some more docs to explain why a FIXME was wrongly added. + 2007-12-22 Sebastian Dröge * gst/gstobject.c: diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c index c20013110e..ee7b889030 100644 --- a/gst/gstsystemclock.c +++ b/gst/gstsystemclock.c @@ -363,7 +363,8 @@ gst_system_clock_id_wait_jitter_unlocked (GstClock * clock, GstClockTime entryt, real, now, target; GstClockTimeDiff diff; - /* need to call the overridden method */ + /* need to call the overridden method because we want to sync against the time + * of the clock, whatever the subclass uses as a clock. */ real = GST_CLOCK_GET_CLASS (clock)->get_internal_time (clock); entryt = GST_CLOCK_ENTRY_TIME (entry); @@ -371,12 +372,13 @@ gst_system_clock_id_wait_jitter_unlocked (GstClock * clock, if (jitter) { *jitter = GST_CLOCK_DIFF (entryt, now); } + /* the diff of the entry with the clock is the amount of time we have to + * wait */ diff = entryt - now; - /* FIXME: should that be not just: - * target = GST_CLOCK_GET_CLASS (clock)->get_internal_time (clock) + diff; - * or even - * target = real + diff; - */ + /* Our GCond implementation expects an absolute time against the system clock + * as a timeout value. We use our internal time to get the system time and add + * the expected timeout to it, this gives us the absolute time of the + * timeout. */ target = gst_system_clock_get_internal_time (clock) + diff; GST_CAT_DEBUG (GST_CAT_CLOCK, "entry %p"