netclock: Make the RTT average ignore large values more forcefully.
authorJan Schmidt <jan@centricular.com>
Thu, 5 Feb 2015 19:07:43 +0000 (06:07 +1100)
committerJan Schmidt <jan@centricular.com>
Fri, 6 Feb 2015 17:38:42 +0000 (04:38 +1100)
Smooth larger RTTs a little harder, so excessively large values
perturb the average a bit less, and therefore get filtered out
more strongly

libs/gst/net/gstnetclientclock.c

index 2d8f0d5..f8caec1 100644 (file)
@@ -351,7 +351,7 @@ gst_net_client_clock_observe_times (GstNetClientClock * self,
   else if (rtt < priv->rtt_avg) /* Shorter RTTs carry more weight than longer */
     priv->rtt_avg = (3 * priv->rtt_avg + rtt) / 4;
   else
-    priv->rtt_avg = (7 * priv->rtt_avg + rtt) / 8;
+    priv->rtt_avg = (15 * priv->rtt_avg + rtt) / 16;
 
   if (rtt > 2 * priv->rtt_avg) {
     GST_LOG_OBJECT (self,