projects
/
platform
/
upstream
/
pulseaudio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c36ab68
)
smoother: avoid losing precision
author
Wim Taymans
<wim.taymans@collabora.co.uk>
Mon, 6 Sep 2010 13:22:26 +0000
(15:22 +0200)
committer
Wim Taymans
<wim.taymans@collabora.co.uk>
Tue, 7 Sep 2010 10:07:24 +0000
(12:07 +0200)
Avoid losing precision by subtracting uint64 values before converting them to
doubles.
src/pulsecore/time-smoother.c
patch
|
blob
|
history
diff --git
a/src/pulsecore/time-smoother.c
b/src/pulsecore/time-smoother.c
index 1371ad562ef51f058cdc27434938ad051c284f91..0696cabc2c6ef4ce22c388b7ccded3dd791dbcb1 100644
(file)
--- a/
src/pulsecore/time-smoother.c
+++ b/
src/pulsecore/time-smoother.c
@@
-320,10
+320,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)));