Commit 2e475b27 authored by Sébastien Escudier's avatar Sébastien Escudier

sap : smooth the announce period average

closes #5462
(cherry picked from commit a04e845438d54c85defa00713bddf9683f9e0993)
Signed-off-by: default avatarSébastien Escudier <sebastien-devel@celeos.eu>
parent 2234919e
...@@ -811,7 +811,7 @@ static int ParseSAP( services_discovery_t *p_sd, const uint8_t *buf, ...@@ -811,7 +811,7 @@ static int ParseSAP( services_discovery_t *p_sd, const uint8_t *buf,
/* Compute the average period */ /* Compute the average period */
mtime_t now = mdate(); 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; p_announce->i_last = now;
} }
FreeSDP( p_sdp ); p_sdp = NULL; FreeSDP( p_sdp ); p_sdp = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment