From 0cc887eb98ff83196d1bdffebe59c8f5a55b79a2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 21 Sep 2013 00:08:20 +0200 Subject: [PATCH] rtpjitterbuffer: append seqnum -1 packets --- gst/rtpmanager/rtpjitterbuffer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst/rtpmanager/rtpjitterbuffer.c b/gst/rtpmanager/rtpjitterbuffer.c index 3641f4cf50..b1623ba14a 100644 --- a/gst/rtpmanager/rtpjitterbuffer.c +++ b/gst/rtpmanager/rtpjitterbuffer.c @@ -656,7 +656,7 @@ gboolean rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, RTPJitterBufferItem * item, gboolean * tail, gint * percent) { - GList *list; + GList *list = NULL; guint32 rtptime; guint16 seqnum; GstClockTime dts; @@ -665,6 +665,9 @@ rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, RTPJitterBufferItem * item, g_return_val_if_fail (item != NULL, FALSE); seqnum = item->seqnum; + /* no seqnum, simply append then */ + if (seqnum == -1) + goto append; /* loop the list to skip strictly smaller seqnum buffers */ for (list = jbuf->packets->head; list; list = g_list_next (list)) { @@ -673,6 +676,8 @@ rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, RTPJitterBufferItem * item, RTPJitterBufferItem *qitem = (RTPJitterBufferItem *) list; qseq = qitem->seqnum; + if (qseq == -1) + continue; /* compare the new seqnum to the one in the buffer */ gap = gst_rtp_buffer_compare_seqnum (seqnum, qseq); @@ -729,6 +734,7 @@ rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, RTPJitterBufferItem * item, * receive dts, this function will return the skew corrected rtptime. */ item->pts = calculate_skew (jbuf, rtptime, dts); +append: queue_do_insert (jbuf, list, (GList *) item); /* buffering mode, update buffer stats */