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:
Wim Taymans 2013-12-27 15:57:39 +01:00
parent 29840bfd96
commit e996f73d0c

View file

@ -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++;
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; 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);