diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-12-09 12:24:09 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-12-09 12:34:29 +0200 |
commit | c88f1c03550ecd994adc2e2f77805dc11720bb09 (patch) | |
tree | 577ac685995f5ae2aee0f6bc6d5059d869f665b2 | |
parent | 5cf5dbad1f166fbbec02adc484a42834f2674dc5 (diff) | |
download | gstreamer-plugins-good-c88f1c03550ecd994adc2e2f77805dc11720bb09.tar.gz |
rtpjitterbuffer: Fix packet dropping after a big discont
We would queue 5 consective packets before considering a reset and a proper
discont here. Instead of expecting the next output packet to have the current
seqnum (i.e. the fifth), expect it to have the first seqnum. Otherwise we're
going to drop all queued up packets.
-rw-r--r-- | gst/rtpmanager/gstrtpjitterbuffer.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index 433e61d7c..e028c3ea7 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -2546,7 +2546,17 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent, remove_all_timers (jitterbuffer); priv->discont = TRUE; priv->last_popped_seqnum = -1; - priv->next_seqnum = seqnum; + + if (priv->gap_packets.head) { + GstBuffer *gap_buffer = priv->gap_packets.head->data; + GstRTPBuffer gap_rtp = GST_RTP_BUFFER_INIT; + + gst_rtp_buffer_map (gap_buffer, GST_MAP_READ, &gap_rtp); + priv->next_seqnum = gst_rtp_buffer_get_seq (&gap_rtp); + gst_rtp_buffer_unmap (&gap_rtp); + } else { + priv->next_seqnum = seqnum; + } priv->last_in_dts = -1; priv->next_in_seqnum = -1; |