[vlc-commits] sap : smooth the announce period average

Sébastien Escudier git at videolan.org
Thu Mar 15 13:41:58 CET 2012


vlc | branch: master | Sébastien Escudier <sebastien-devel at celeos.eu> | Thu Mar 15 13:17:07 2012 +0100| [a04e845438d54c85defa00713bddf9683f9e0993] | committer: Sébastien Escudier

sap : smooth the announce period average
closes #5462

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a04e845438d54c85defa00713bddf9683f9e0993
---

 modules/services_discovery/sap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index a103bc7..38775e0 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -811,7 +811,7 @@ static int ParseSAP( services_discovery_t *p_sd, const uint8_t *buf,
 
                 /* Compute the average period */
                 mtime_t now = mdate();
-                p_announce->i_period = (p_announce->i_period + (now - p_announce->i_last)) / 2;
+                p_announce->i_period = ( p_announce->i_period * (p_announce->i_period_trust-1) + (now - p_announce->i_last) ) / p_announce->i_period_trust;
                 p_announce->i_last = now;
             }
             FreeSDP( p_sdp ); p_sdp = NULL;



More information about the vlc-commits mailing list