]> code.delx.au - pulseaudio/commitdiff
fix up monotonicity of input to _get() instead of hitting an assert
authorLennart Poettering <lennart@poettering.net>
Wed, 25 Jun 2008 22:29:59 +0000 (00:29 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 25 Jun 2008 22:29:59 +0000 (00:29 +0200)
src/pulsecore/time-smoother.c

index fe5a4f18084bb05e1663a610905ecdc7310c7bc6..013edfc6457969268b050cf8e2b00432675a064a 100644 (file)
@@ -373,12 +373,15 @@ pa_usec_t pa_smoother_get(pa_smoother *s, pa_usec_t x) {
 
     x = PA_LIKELY(x >= s->time_offset) ? x - s->time_offset : 0;
 
+    if (s->monotonic)
+        if (x <= s->last_x)
+            x = s->last_x;
+
     estimate(s, x, &y, NULL);
 
     if (s->monotonic) {
 
         /* Make sure the querier doesn't jump forth and back. */
-        pa_assert(x >= s->last_x);
         s->last_x = x;
 
         if (y < s->last_y)