diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-06-25 13:27:02 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-06-25 13:27:02 +0000 |
commit | 1028a42bfdd13453b39c3a19ebc59959df565bec (patch) | |
tree | e3c61d6e88949e0711963da9d30b751d817829e7 /pjlib | |
parent | d749012c94efaf397371b2294618465ec00fea08 (diff) |
Ticket #773 (mixed fixes): backported changes from #772:
- from r2566: bug in pjsua application when reading the URL from the buddy list, causing corrupt/invalid URI to be returned. Thanks Robert Cichielo for the report.
- from r2577: Updated floating point version of math statistic to return the rounded mean value.
- from r2586: Updated stream_destroy() to call jbuf_destroy().
- from r2604: Changed var 'test' (in sdp_neg_test.c) from a global var to static var, since there was naming conflict with libg7221codec.
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.0@2818 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/include/pj/math.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pjlib/include/pj/math.h b/pjlib/include/pj/math.h index 9df5eeb2..8d202dbf 100644 --- a/pjlib/include/pj/math.h +++ b/pjlib/include/pj/math.h @@ -140,7 +140,9 @@ PJ_INLINE(void) pj_math_stat_update(pj_math_stat *stat, int val) #if PJ_HAS_FLOATING_POINT delta = val - stat->fmean_; stat->fmean_ += delta/stat->n; - stat->mean = (int) stat->fmean_; + + /* Return mean value with 'rounding' */ + stat->mean = (int) (stat->fmean_ + 0.5); stat->m2_ += (int)(delta * (val-stat->fmean_)); #else |