utils: use g_get_monotonic_time() as fallback in gst_utils_get_timestamp()
authorTim-Philipp Müller <tim@centricular.com>
Thu, 11 Jan 2018 18:44:50 +0000 (18:44 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 11 Jan 2018 18:44:50 +0000 (18:44 +0000)
This is a better fit given that the function docs say this
should (only) be used for interval measurements, but also
this seems to give much better granularity on Windows
systems, where before this change there would often be
10-20 lines of debug log with the same timestamp up front.

gst/gstutils.c

index 447fcf8..7c1618a 100644 (file)
@@ -3461,10 +3461,7 @@ gst_util_get_timestamp (void)
   clock_gettime (CLOCK_MONOTONIC, &now);
   return GST_TIMESPEC_TO_TIME (now);
 #else
-  GTimeVal now;
-
-  g_get_current_time (&now);
-  return GST_TIMEVAL_TO_TIME (now);
+  return g_get_monotonic_time () * 1000;
 #endif
 }