diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-04-05 02:26:02 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-04-05 02:26:02 +0200 |
commit | d035f4a3f3e73fd67d69a03c03adc9a08f30ef21 (patch) | |
tree | 52316988c7bcbd495ba4a53a337f7c9b3c813286 /src/modules/module-tunnel.c | |
parent | 1c26d7e174ba54c062c0ae50d33bf4e819bb15ba (diff) |
Modify smoothing code to make cubic interpolation optional and allow 'quick fixups' on resuming
The primary reason for this change is to allow time graphs that do not
go through the origin and hence smoothing starting from the origin is
not desired. This change will allow passing time data into the smoother
while paused and then abruptly use that data without smoothing using the
'quick fixup' flag when resuming.
Primary use case is allowing recording time graphs where the data
recorded originates from a time before the stream was created. The
resulting graft will be shifted and should not be smoothened to go
through the origin.
Diffstat (limited to 'src/modules/module-tunnel.c')
-rw-r--r-- | src/modules/module-tunnel.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c index 1d658ba0..5ea58aa0 100644 --- a/src/modules/module-tunnel.c +++ b/src/modules/module-tunnel.c @@ -405,7 +405,7 @@ static void check_smoother_status(struct userdata *u, pa_bool_t past) { if (u->remote_suspended || u->remote_corked) pa_smoother_pause(u->smoother, x); else - pa_smoother_resume(u->smoother, x); + pa_smoother_resume(u->smoother, x, TRUE); } /* Called from IO thread context */ @@ -1815,7 +1815,14 @@ int pa__init(pa_module*m) { u->source_name = pa_xstrdup(pa_modargs_get_value(ma, "source", NULL));; u->source = NULL; #endif - u->smoother = pa_smoother_new(PA_USEC_PER_SEC, PA_USEC_PER_SEC*2, TRUE, 10); + u->smoother = pa_smoother_new( + PA_USEC_PER_SEC, + PA_USEC_PER_SEC*2, + TRUE, + TRUE, + 10, + pa_rtclock_usec(), + FALSE); u->ctag = 1; u->device_index = u->channel = PA_INVALID_INDEX; u->time_event = NULL; @@ -1933,8 +1940,6 @@ int pa__init(pa_module*m) { u->fragsize = (uint32_t) -1; #endif - pa_smoother_set_time_offset(u->smoother, pa_rtclock_usec()); - if (!(u->thread = pa_thread_new(thread_func, u))) { pa_log("Failed to create thread."); goto fail; |