[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test7-34-g7fc2382
Lennart Poettering
gitmailer-noreply at 0pointer.de
Mon Apr 6 07:38:42 PDT 2009
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from daa945aa324af5b71332a3cd07890d1cf3a1cb60 (commit)
- Log -----------------------------------------------------------------
7fc2382 properly handle interpolation when queried x is left of last data position
-----------------------------------------------------------------------
Summary of changes:
src/pulsecore/time-smoother.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
-----------------------------------------------------------------------
commit 7fc2382a0aaaec70401468940afd266252bda178
Author: Lennart Poettering <lennart at poettering.net>
Date: Mon Apr 6 16:38:38 2009 +0200
properly handle interpolation when queried x is left of last data position
diff --git a/src/pulsecore/time-smoother.c b/src/pulsecore/time-smoother.c
index 55ac868..047ab6c 100644
--- a/src/pulsecore/time-smoother.c
+++ b/src/pulsecore/time-smoother.c
@@ -291,7 +291,8 @@ static void estimate(pa_smoother *s, pa_usec_t x, pa_usec_t *y, double *deriv) {
pa_assert(s);
pa_assert(y);
- if (!s->smoothing || x >= s->px) {
+ if (x >= s->px) {
+ /* Linear interpolation right from px */
int64_t t;
/* The requested point is right of the point where we wanted
@@ -307,7 +308,22 @@ static void estimate(pa_smoother *s, pa_usec_t x, pa_usec_t *y, double *deriv) {
if (deriv)
*deriv = s->dp;
+ } else if (x <= s->ex) {
+ /* Linear interpolation left from ex */
+ int64_t t;
+
+ t = (int64_t) s->ey - (int64_t) llrint(s->de * (double) (s->ex - x));
+
+ if (t < 0)
+ t = 0;
+
+ *y = (pa_usec_t) t;
+
+ if (deriv)
+ *deriv = s->de;
+
} else {
+ /* Spline interpolation between ex and px */
double tx, ty;
/* Ok, we're not yet on track, thus let's interpolate, and
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list