From cdbb2ba6b8550d1527acdc5baaf0184658489ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 16 Jan 2014 17:36:12 -0800 Subject: [PATCH] rtpjitterbuffer: do not drop serialized events when latency is set Serialized events are now queued in the jitter buffer, so we don't want to drop them even latency is set. https://bugzilla.gnome.org/show_bug.cgi?id=722372 --- gst/rtpmanager/gstrtpjitterbuffer.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index e1a736007c..4b61bb3a42 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -2210,11 +2210,16 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent, if (G_UNLIKELY (rtp_jitter_buffer_get_ts_diff (priv->jbuf) >= latency_ts)) { RTPJitterBufferItem *old_item; - old_item = rtp_jitter_buffer_pop (priv->jbuf, &percent); - GST_DEBUG_OBJECT (jitterbuffer, "Queue full, dropping old packet %p", - old_item); - priv->next_seqnum = (old_item->seqnum + 1) & 0xffff; - free_item (old_item); + old_item = rtp_jitter_buffer_peek (priv->jbuf); + + /* only drop non-event buffers */ + if (old_item->type != ITEM_TYPE_EVENT) { + old_item = rtp_jitter_buffer_pop (priv->jbuf, &percent); + GST_DEBUG_OBJECT (jitterbuffer, "Queue full, dropping old packet %p", + old_item); + priv->next_seqnum = (old_item->seqnum + 1) & 0xffff; + free_item (old_item); + } } }