mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +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;
|
expected_dts = priv->last_in_dts + duration;
|
||||||
|
|
||||||
if (priv->do_retransmission) {
|
if (priv->do_retransmission) {
|
||||||
|
TimerData *timer;
|
||||||
|
|
||||||
type = TIMER_TYPE_EXPECTED;
|
type = TIMER_TYPE_EXPECTED;
|
||||||
/* if we had a timer for the first missing packet, leave it. */
|
/* if we had a timer for the first missing packet, update it. */
|
||||||
if (find_timer (jitterbuffer, type, expected)) {
|
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++;
|
||||||
expected_dts += duration;
|
expected_dts += duration;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue