diff options
author | Lennart Poettering <lennart@poettering.net> | 2007-10-29 16:38:57 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2007-10-29 16:38:57 +0000 |
commit | 6e1f7bd144d2f5ce8cb5f30772b2ad31652ab213 (patch) | |
tree | f4d1907f8b692f7f0bac42859b019000c66521d9 /src/pulsecore/time-smoother.c | |
parent | a46804a8e2ba8aa0e869bcf72015e3b551a7b40d (diff) | |
download | pulseaudio-6e1f7bd144d2f5ce8cb5f30772b2ad31652ab213.tar.gz |
properly deal with time pausing
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1977 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/time-smoother.c')
-rw-r--r-- | src/pulsecore/time-smoother.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/pulsecore/time-smoother.c b/src/pulsecore/time-smoother.c index 6bda3df06..4cebded4d 100644 --- a/src/pulsecore/time-smoother.c +++ b/src/pulsecore/time-smoother.c @@ -310,8 +310,9 @@ void pa_smoother_put(pa_smoother *s, pa_usec_t x, pa_usec_t y) { /* Fix up x value */ if (s->paused) x = s->pause_time; - else - x -= s->time_offset; + + pa_assert(x >= s->time_offset); + x -= s->time_offset; pa_assert(x >= s->ex); @@ -342,8 +343,9 @@ pa_usec_t pa_smoother_get(pa_smoother *s, pa_usec_t x) { /* Fix up x value */ if (s->paused) x = s->pause_time; - else - x -= s->time_offset; + + pa_assert(x >= s->time_offset); + x -= s->time_offset; pa_assert(x >= s->ex); @@ -373,6 +375,8 @@ void pa_smoother_resume(pa_smoother *s, pa_usec_t x) { if (!s->paused) return; + pa_assert(x >= s->pause_time); + s->paused = FALSE; s->time_offset += x - s->pause_time; } |