rtpjitterbuffer: If we have an immediate timeout, don't try to find an earlier timeout
authorSebastian Dröge <sebastian@centricular.com>
Mon, 29 Jun 2015 08:14:05 +0000 (10:14 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 29 Jun 2015 08:14:05 +0000 (10:14 +0200)
If we have lots of such immediate timeouts, we would otherwise have quadratic
runtime in the number of timeouts.

gst/rtpmanager/gstrtpjitterbuffer.c

index 8f9c51f..306f04a 100644 (file)
@@ -3315,6 +3315,10 @@ wait_next_timeout (GstRtpJitterBuffer * jitterbuffer)
         GST_DEBUG_OBJECT (jitterbuffer, "new best %d", i);
         timer = test;
         timer_timeout = test_timeout;
+
+        /* Immediate timeout */
+        if (test_timeout == -1)
+          break;
       }
     }
     if (timer && !priv->blocked) {