summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-09-12 13:42:49 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-09-12 13:42:49 +0200
commitf65a413500d61834a479bb5e53d4c37c9335823a (patch)
tree32aa966a0b52eb20f30b3e4002e589fb84e79cea
parente6047734b3168af1eb8c1501e02e2f5213f6462e (diff)
glibcompat: add replacement for g_cond_wait_until().
-rw-r--r--gst-libs/gst/vaapi/glibcompat.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/glibcompat.h b/gst-libs/gst/vaapi/glibcompat.h
index 30a8563..0a6115c 100644
--- a/gst-libs/gst/vaapi/glibcompat.h
+++ b/gst-libs/gst/vaapi/glibcompat.h
@@ -74,4 +74,18 @@ g_clear_object_inline(volatile GObject **object_ptr)
#define g_static_rec_mutex_unlock(m) g_rec_mutex_unlock(m)
#endif
+#if !GLIB_CHECK_VERSION(2,31,2)
+static inline gboolean
+g_cond_wait_until(GCond *cond, GMutex *mutex, gint64 end_time)
+{
+ gint64 diff_time;
+ GTimeVal timeout;
+
+ diff_time = end_time - g_get_monotonic_time();
+ g_get_current_time(&timeout);
+ g_time_val_add(&timeout, diff_time > 0 ? diff_time : 0);
+ return g_cond_timed_wait(cond, mutex, &timeout);
+}
+#endif
+
#endif /* GLIB_COMPAT_H */