Revert "rtpjitterbuffer: Fix expected_dts calc in calculate_expected"
authorStian Selnes <stian@pexip.com>
Tue, 30 Jun 2015 09:21:31 +0000 (11:21 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 8 Jul 2015 20:18:48 +0000 (23:18 +0300)
This reverts commit 05bd708fc5e881390fe839803b53144393d95ab0.

The reverted patch is wrong and introduces a regression because there
may still be time to receive some of the packets included in the gap
if they are reordered.

gst/rtpmanager/gstrtpjitterbuffer.c

index 6a5a59f5d3c1d6e50e9326028af625e69a5b58cb..b1198f0bc21e9bfd0ee1c6a67167f380e6c4b0a1 100644 (file)
@@ -2100,7 +2100,6 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected,
   GstRtpJitterBufferPrivate *priv = jitterbuffer->priv;
   GstClockTime total_duration, duration, expected_dts;
   TimerType type;
-  guint lost_packets = 0;
 
   GST_DEBUG_OBJECT (jitterbuffer,
       "dts %" GST_TIME_FORMAT ", last %" GST_TIME_FORMAT,
@@ -2127,6 +2126,7 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected,
 
   if (total_duration > priv->latency_ns) {
     GstClockTime gap_time;
+    guint lost_packets;
 
     gap_time = total_duration - priv->latency_ns;
 
@@ -2153,7 +2153,7 @@ calculate_expected (GstRtpJitterBuffer * jitterbuffer, guint32 expected,
     priv->last_in_dts += gap_time;
   }
 
-  expected_dts = priv->last_in_dts + (lost_packets + 1) * duration;
+  expected_dts = priv->last_in_dts + duration;
 
   if (priv->do_retransmission) {
     TimerData *timer;