mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
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.
This commit is contained in:
parent
fdc1ed1680
commit
1760817005
1 changed files with 12 additions and 2 deletions
|
@ -1782,9 +1782,19 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected,
|
|||
expected_dts = priv->last_in_dts + duration;
|
||||
|
||||
if (priv->do_retransmission) {
|
||||
TimerData *timer;
|
||||
|
||||
type = TIMER_TYPE_EXPECTED;
|
||||
/* 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++;
|
||||
expected_dts += duration;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue