Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > media > main-testing-src > by-pkgid > 21c921d7e2a28ff702b2a7da09d43ed6 > files > 82

pulseaudio-0.9.21-26.0.4mdv2010.1.src.rpm

From 3d9b710bea79a3663aa7f78a182991e3e1502ecf Mon Sep 17 00:00:00 2001
From: Wim Taymans <wim.taymans@collabora.co.uk>
Date: Mon, 6 Sep 2010 15:22:26 +0200
Subject: [PATCH 181/186] smoother: avoid losing precision

Avoid losing precision by subtracting uint64 values before converting them to
doubles.
---
 src/pulsecore/time-smoother.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/pulsecore/time-smoother.c b/src/pulsecore/time-smoother.c
index d6c3787..422f12d 100644
--- a/src/pulsecore/time-smoother.c
+++ b/src/pulsecore/time-smoother.c
@@ -313,10 +313,8 @@ static void estimate(pa_smoother *s, pa_usec_t x, pa_usec_t *y, double *deriv) {
 
         calc_abc(s);
 
-        tx = (double) x;
-
         /* Move to origin */
-        tx -= (double) s->ex;
+        tx = (double) (x - s->ex);
 
         /* Horner scheme */
         ty = (tx * (s->c + tx * (s->b + tx * s->a)));
-- 
1.7.2.3