diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-07-08 15:13:17 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-07-08 15:15:00 +0300 |
commit | 243730ced44e61997f5338007ccc3c3dae6f337a (patch) | |
tree | cd9752a9511e257064a3a6049a280e9398203669 | |
parent | 5439fc9a0cd2ccd1952152a56f11c48cf93a7f1a (diff) |
rtpjitterbuffer: Handle seqnum gaps in TCP streams without erroring out or overflowing calculations
That is, handle DTS==GST_CLOCK_TIME_NONE correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=749536
-rw-r--r-- | gst/rtpmanager/gstrtpjitterbuffer.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index 3240089e9..079cac38f 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -2030,7 +2030,7 @@ update_timers (GstRtpJitterBuffer * jitterbuffer, guint16 seqnum, } } - if (do_next_seqnum) { + if (do_next_seqnum && dts != GST_CLOCK_TIME_NONE) { GstClockTime expected, delay; /* calculate expected arrival time of the next seqnum */ @@ -2106,6 +2106,10 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected, "dts %" GST_TIME_FORMAT ", last %" GST_TIME_FORMAT, GST_TIME_ARGS (dts), GST_TIME_ARGS (priv->last_in_dts)); + /* Nothing to be done here if we don't get packet receive times */ + if (dts == GST_CLOCK_TIME_NONE) + return; + /* the total duration spanned by the missing packets */ if (dts >= priv->last_in_dts) total_duration = dts - priv->last_in_dts; @@ -2449,12 +2453,7 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent, } else { gboolean reset = FALSE; - 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) { + if (gap < 0) { /* we received an old packet */ if (G_UNLIKELY (gap != -1 && gap < -RTP_MAX_MISORDER)) { reset = @@ -2707,15 +2706,6 @@ 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); - ret = GST_FLOW_ERROR; - goto finished; - } } static GstClockTime |