+2006-05-30 Jan Schmidt <thaytan@mad.scientist.com>
+
+ * gst/gstsystemclock.c: (gst_system_clock_id_wait_unlocked):
+ Add debug that can be enabled using a #define at the top of the file,
+ for dumping stats about how late/early we were when waking up from
+ waiting on the clock.
+
2006-05-30 Wim Taymans <wim@fluendo.com>
* libs/gst/base/gstcollectpads.c: (gst_collect_pads_check_pads):
#include "gstsystemclock.h"
+/* Define this to get some extra debug about jitter from each clock_wait */
+#undef WAIT_DEBUGGING
+
/* the one instance of the systemclock */
static GstClock *_the_system_clock = NULL;
if (diff > 0) {
GTimeVal tv;
+#ifdef WAIT_DEBUGGING
+ GstClockTime result, final;
+#endif
+
GST_TIME_TO_TIMEVAL (target, tv);
while (TRUE) {
/* timeout, this is fine, we can report success now */
GST_CAT_DEBUG (GST_CAT_CLOCK, "entry %p unlocked after timeout", entry);
entry->status = GST_CLOCK_OK;
+
+#ifdef WAIT_DEBUGGING
+ real = GST_CLOCK_GET_CLASS (clock)->get_internal_time (clock);
+ result = gst_clock_adjust_unlocked (clock, real);
+ final = gst_system_clock_get_internal_time (clock);
+ GST_CAT_DEBUG (GST_CAT_CLOCK, "Waited for %" G_GINT64_FORMAT
+ " got %" G_GINT64_FORMAT " diff %" G_GINT64_FORMAT
+ " %g target-offset %" G_GINT64_FORMAT " %g", entryt, result,
+ result - entryt,
+ (double) (GstClockTimeDiff) (result - entryt) / GST_SECOND,
+ (final - target),
+ ((double) (GstClockTimeDiff) (final - target)) / GST_SECOND);
+#endif
+
break;
} else {
/* the waiting is interrupted because the GCond was signaled. This can