mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 22:06:41 +00:00
jitterbuffer: take more accurate running-time for NACK
Don't use the current time calculated from the tmieout loop for when we last scheduled the NACK because it might be unscheduled because of a max packet misorder and then we don't accurately calculate the current time. Instead, take the current element running time using the clock.
This commit is contained in:
parent
29840bfd96
commit
e996f73d0c
1 changed files with 10 additions and 1 deletions
|
@ -2490,6 +2490,7 @@ do_expected_timeout (GstRtpJitterBuffer * jitterbuffer, TimerData * timer,
|
||||||
GstRtpJitterBufferPrivate *priv = jitterbuffer->priv;
|
GstRtpJitterBufferPrivate *priv = jitterbuffer->priv;
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
guint delay;
|
guint delay;
|
||||||
|
GstClock *clock;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (jitterbuffer, "expected %d didn't arrive", timer->seqnum);
|
GST_DEBUG_OBJECT (jitterbuffer, "expected %d didn't arrive", timer->seqnum);
|
||||||
|
|
||||||
|
@ -2507,7 +2508,15 @@ do_expected_timeout (GstRtpJitterBuffer * jitterbuffer, TimerData * timer,
|
||||||
|
|
||||||
priv->num_rtx_requests++;
|
priv->num_rtx_requests++;
|
||||||
timer->num_rtx_retry++;
|
timer->num_rtx_retry++;
|
||||||
timer->rtx_last = now;
|
|
||||||
|
GST_OBJECT_LOCK (jitterbuffer);
|
||||||
|
if ((clock = GST_ELEMENT_CLOCK (jitterbuffer))) {
|
||||||
|
timer->rtx_last = gst_clock_get_time (clock);
|
||||||
|
timer->rtx_last -= GST_ELEMENT_CAST (jitterbuffer)->base_time;
|
||||||
|
} else {
|
||||||
|
timer->rtx_last = now;
|
||||||
|
}
|
||||||
|
GST_OBJECT_UNLOCK (jitterbuffer);
|
||||||
|
|
||||||
/* calculate the timeout for the next retransmission attempt */
|
/* calculate the timeout for the next retransmission attempt */
|
||||||
timer->rtx_retry += (priv->rtx_retry_timeout * GST_MSECOND);
|
timer->rtx_retry += (priv->rtx_retry_timeout * GST_MSECOND);
|
||||||
|
|
Loading…
Reference in a new issue