[vlc-commits] sap : smooth the announce period average
Sébastien Escudier
git at videolan.org
Thu Mar 15 15:36:44 CET 2012
vlc/vlc-2.0 | branch: master | Sébastien Escudier <sebastien-devel at celeos.eu> | Thu Mar 15 13:17:07 2012 +0100| [2e475b27b0c535a40b96f66b5703e7f2a83b8f84] | committer: Sébastien Escudier
sap : smooth the announce period average
closes #5462
(cherry picked from commit a04e845438d54c85defa00713bddf9683f9e0993)
Signed-off-by: Sébastien Escudier <sebastien-devel at celeos.eu>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=2e475b27b0c535a40b96f66b5703e7f2a83b8f84
---
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