diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-07-28 01:35:19 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-07-28 01:35:19 +0200 |
commit | 09e57c2ee9c731805e97f07771a18dfc4c917318 (patch) | |
tree | ef48805839f8bede8accef8c1eed47ef6a9e3372 /src/pulsecore/time-smoother.c | |
parent | 835a2ae83a6cca344608ce9504f8d69da9d112fc (diff) | |
parent | 8343360da1d8d93e8e3818ab91e7f764a1c8c99e (diff) |
Merge branch 'master' into master-tx
Diffstat (limited to 'src/pulsecore/time-smoother.c')
-rw-r--r-- | src/pulsecore/time-smoother.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/pulsecore/time-smoother.c b/src/pulsecore/time-smoother.c index 9d5a0705..1289f2b6 100644 --- a/src/pulsecore/time-smoother.c +++ b/src/pulsecore/time-smoother.c @@ -108,29 +108,11 @@ pa_smoother* pa_smoother_new( s = pa_xnew(pa_smoother, 1); s->adjust_time = adjust_time; s->history_time = history_time; - s->time_offset = 0; + s->min_history = min_history; s->monotonic = monotonic; - - s->px = s->py = 0; - s->dp = 1; - - s->ex = s->ey = s->ry = 0; - s->de = 1; - - s->history_idx = 0; - s->n_history = 0; - - s->last_y = s->last_x = 0; - - s->abc_valid = FALSE; - - s->paused = FALSE; s->smoothing = smoothing; - s->min_history = min_history; - - s->paused = paused; - s->time_offset = s->pause_time = time_offset; + pa_smoother_reset(s, time_offset, paused); return s; } @@ -514,9 +496,26 @@ pa_usec_t pa_smoother_translate(pa_smoother *s, pa_usec_t x, pa_usec_t y_delay) return (pa_usec_t) llrint((double) y_delay / nde); } -void pa_smoother_reset(pa_smoother *s) { +void pa_smoother_reset(pa_smoother *s, pa_usec_t time_offset, pa_bool_t paused) { pa_assert(s); + s->px = s->py = 0; + s->dp = 1; + + s->ex = s->ey = s->ry = 0; + s->de = 1; + + s->history_idx = 0; s->n_history = 0; + + s->last_y = s->last_x = 0; + s->abc_valid = FALSE; + + s->paused = paused; + s->time_offset = s->pause_time = time_offset; + + /* #ifdef DEBUG_DATA */ + pa_log_debug("reset()"); +/* #endif */ } |