diff options
author | Havard Graff <havard.graff@gmail.com> | 2016-08-11 12:02:19 +0200 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2016-09-14 19:37:50 -0400 |
commit | 8087a8a31c5ae304a98d1ce174245528d79f7ba3 (patch) | |
tree | 46f657327a07a07acdd82525d2a34513e75830d8 /gst/rtpmanager | |
parent | 38a754500307055a36d88d7b236e13c99274f97c (diff) |
rtpjitterbuffer: Improved expected-timer handling when gap > 0
https://bugzilla.gnome.org/show_bug.cgi?id=769768
Diffstat (limited to 'gst/rtpmanager')
-rw-r--r-- | gst/rtpmanager/gstrtpjitterbuffer.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index f8bfeb90d..d00e5f2d4 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -2404,7 +2404,7 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected, guint16 seqnum, GstClockTime dts, gint gap) { GstRtpJitterBufferPrivate *priv = jitterbuffer->priv; - GstClockTime total_duration, duration, expected_dts; + GstClockTime total_duration, duration, expected_dts, delay; TimerType type; GST_DEBUG_OBJECT (jitterbuffer, @@ -2466,18 +2466,20 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected, } expected_dts = priv->last_in_dts + duration; + delay = 0; if (priv->do_retransmission) { TimerData *timer = find_timer (jitterbuffer, expected); type = TIMER_TYPE_EXPECTED; + delay = get_rtx_delay (priv); + /* if we had a timer for the first missing packet, update it. */ if (timer && timer->type == TIMER_TYPE_EXPECTED) { GstClockTime timeout = timer->timeout; timer->duration = duration; - if (timeout > (expected_dts + timer->rtx_retry)) { - GstClockTime delay = timeout - expected_dts - timer->rtx_retry; + if (timeout > (expected_dts + delay) && timer->num_rtx_retry == 0) { reschedule_timer (jitterbuffer, timer, timer->seqnum, expected_dts, delay, TRUE); } @@ -2489,7 +2491,7 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected, } while (gst_rtp_buffer_compare_seqnum (expected, seqnum) > 0) { - add_timer (jitterbuffer, type, expected, 0, expected_dts, 0, duration); + add_timer (jitterbuffer, type, expected, 0, expected_dts, delay, duration); expected_dts += duration; expected++; } |