jitterbuffer: reset is only possible with a GAP

This commit is contained in:
Wim Taymans 2013-08-01 11:40:41 +02:00
parent f864131227
commit 9d88ac9cbb

View file

@ -1352,10 +1352,11 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent,
/* now check against our expected seqnum */
if (G_LIKELY (priv->next_in_seqnum != -1)) {
gint gap;
gboolean reset = FALSE;
gap = gst_rtp_buffer_compare_seqnum (priv->next_in_seqnum, seqnum);
if (G_UNLIKELY (gap != 0)) {
gboolean reset = FALSE;
GST_DEBUG_OBJECT (jitterbuffer, "expected #%d, got #%d, gap of %d",
priv->next_in_seqnum, seqnum, gap);
/* priv->next_in_seqnum >= seqnum, this packet is too late or the
@ -1372,7 +1373,6 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent,
} else {
GST_DEBUG_OBJECT (jitterbuffer, "tolerable gap");
}
}
if (G_UNLIKELY (reset)) {
GST_DEBUG_OBJECT (jitterbuffer, "flush and reset jitterbuffer");
rtp_jitter_buffer_flush (priv->jbuf);
@ -1382,6 +1382,7 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent,
priv->next_seqnum = seqnum;
}
}
}
priv->next_in_seqnum = (seqnum + 1) & 0xffff;
/* let's check if this buffer is too late, we can only accept packets with