mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
glibcompat: add replacement for g_async_queue_timeout_pop().
g_async_queue_timeout_pop() appeared in glib 2.31.18. Implement it as g_async_queue_timed_pop() with a GTimeVal as the final time to wait for new data to arrive in the queue.
This commit is contained in:
parent
20a81f5a70
commit
56bc1ce98c
1 changed files with 12 additions and 0 deletions
|
@ -135,6 +135,18 @@ g_cond_wait_until(GCompatCond *cond, GStaticMutex *mutex, gint64 end_time)
|
||||||
#define g_cond_wait(cond, mutex) g_compat_cond_wait(cond, mutex)
|
#define g_cond_wait(cond, mutex) g_compat_cond_wait(cond, mutex)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION(2,31,18)
|
||||||
|
static inline gpointer
|
||||||
|
g_async_queue_timeout_pop(GAsyncQueue *queue, guint64 timeout)
|
||||||
|
{
|
||||||
|
GTimeVal end_time;
|
||||||
|
|
||||||
|
g_get_current_time(&end_time);
|
||||||
|
g_time_val_add(&end_time, timeout);
|
||||||
|
return g_async_queue_timed_pop(queue, &end_time);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef G_COMPAT_DEFINE
|
#undef G_COMPAT_DEFINE
|
||||||
|
|
||||||
#endif /* GLIB_COMPAT_H */
|
#endif /* GLIB_COMPAT_H */
|
||||||
|
|
Loading…
Reference in a new issue