diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-01-07 18:05:18 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-01-07 18:05:18 +0100 |
commit | 87c8c163a876f45024a817e17af6dfdc52e71257 (patch) | |
tree | 905f83c6a7626033ebf732fbb583f6b09049e39f | |
parent | 07c5d1820abc99a6f330091acd84f58042908860 (diff) |
rtpjitterbuffer: If we get a gap with a buffer without DTS, error out
We (currently?) can't really handle gaps between RTP packets if they're not
properly timestamped. The current code would go into calculations with
GST_CLOCK_TIME_NONE and then cause assertions everywhere. It's probably
better to error out cleanly instead.
-rw-r--r-- | gst/rtpmanager/gstrtpjitterbuffer.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index fee6b60ba..dfaea37ed 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -2222,7 +2222,12 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent, } else { gboolean reset = FALSE; - if (gap < 0) { + if (!GST_CLOCK_TIME_IS_VALID (dts)) { + /* We would run into calculations with GST_CLOCK_TIME_NONE below + * and can't compensate for anything without DTS on RTP packets + */ + goto gap_but_no_dts; + } else if (gap < 0) { /* we received an old packet */ if (G_UNLIKELY (gap < -RTP_MAX_MISORDER)) { /* too old packet, reset */ @@ -2405,6 +2410,14 @@ duplicate: free_item (item); goto finished; } +gap_but_no_dts: + { + /* this is fatal as we can't compensate for gaps without DTS */ + GST_ELEMENT_ERROR (jitterbuffer, STREAM, DECODE, (NULL), + ("Received packet without DTS after a gap")); + gst_buffer_unref (buffer); + return GST_FLOW_ERROR; + } } static GstClockTime |