]> code.delx.au - pulseaudio/commitdiff
make sure to use 64bit rounding even on 32bit machines when converting to pa_usec_t
authorLennart Poettering <lennart@poettering.net>
Fri, 24 Oct 2008 02:34:10 +0000 (04:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 24 Oct 2008 02:34:10 +0000 (04:34 +0200)
src/pulsecore/time-smoother.c

index 6a2ffaa67ad8e90b0f8cdee4e7b97ac7cae40bf7..6562194893710fde54bd3beaf5f0f1099167025e 100644 (file)
@@ -313,7 +313,7 @@ static void estimate(pa_smoother *s, pa_usec_t x, pa_usec_t *y, double *deriv) {
         /* Move back from origin */
         ty += (double) s->ey;
 
-        *y = ty >= 0 ? (pa_usec_t) lrint(ty) : 0;
+        *y = ty >= 0 ? (pa_usec_t) llrint(ty) : 0;
 
         /* Horner scheme */
         if (deriv)
@@ -360,7 +360,7 @@ void pa_smoother_put(pa_smoother *s, pa_usec_t x, pa_usec_t y) {
 
     /* And calculate when we want to be on track again */
     s->px = s->ex + s->adjust_time;
-    s->py = s->ry + (pa_usec_t) lrint(s->dp * (double) s->adjust_time);
+    s->py = s->ry + (pa_usec_t) llrint(s->dp * (double) s->adjust_time);
 
     s->abc_valid = FALSE;
 
@@ -456,7 +456,7 @@ pa_usec_t pa_smoother_translate(pa_smoother *s, pa_usec_t x, pa_usec_t y_delay)
 
 /*     pa_log_debug("translate(%llu) = %llu (%0.2f)", (unsigned long long) y_delay, (unsigned long long) ((double) y_delay / nde), nde); */
 
-    return (pa_usec_t) lrint((double) y_delay / nde);
+    return (pa_usec_t) llrint((double) y_delay / nde);
 }
 
 void pa_smoother_reset(pa_smoother *s) {