Commit 17608170 authored by Wim Taymans's avatar Wim Taymans

rtpjitterbuffer: update expected timer when possible

When we receive a packet and we have some missing packets, we can update their
estimated arrival times based on the timestamp difference.
parent fdc1ed16
......@@ -1782,9 +1782,19 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected,
expected_dts = priv->last_in_dts + duration;
if (priv->do_retransmission) {
TimerData *timer;
/* if we had a timer for the first missing packet, leave it. */
if (find_timer (jitterbuffer, type, expected)) {
/* if we had a timer for the first missing packet, update it. */
if ((timer = find_timer (jitterbuffer, type, expected))) {
GstClockTime timeout = timer->timeout;
timer->duration = duration;
if (timeout > expected_dts) {
GstClockTime delay = timeout - expected_dts - timer->rtx_retry;
reschedule_timer (jitterbuffer, timer, timer->seqnum, expected_dts,
delay, TRUE);
expected_dts += duration;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment