rtpjitterbuffer: g_queue_clear_full introduced in glib 2.60
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Tue, 9 Jun 2020 20:09:20 +0000 (13:09 -0700)
committerU. Artie Eoff <ullysses.a.eoff@intel.com>
Tue, 9 Jun 2020 20:09:20 +0000 (13:09 -0700)
Define g_queue_clear_full if glib < 2.60.

Fixes #747

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/619>

gst/rtpmanager/gstrtpjitterbuffer.c

index 1d698ba..f39b6ce 100644 (file)
@@ -269,6 +269,18 @@ enum
 #define GST_BUFFER_IS_RETRANSMISSION(buffer) \
   GST_BUFFER_FLAG_IS_SET (buffer, GST_RTP_BUFFER_FLAG_RETRANSMISSION)
 
+#if !GLIB_CHECK_VERSION(2, 60, 0)
+#define g_queue_clear_full queue_clear_full
+static void
+queue_clear_full (GQueue * queue, GDestroyNotify free_func)
+{
+  gpointer data;
+
+  while ((data = g_queue_pop_head (queue)) != NULL)
+    free_func (data);
+}
+#endif
+
 struct _GstRtpJitterBufferPrivate
 {
   GstPad *sinkpad, *srcpad;