summaryrefslogtreecommitdiffstats
path: root/src/modules/module-esound-sink.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-04-05 02:26:02 +0200
committerLennart Poettering <lennart@poettering.net>2009-04-05 02:26:02 +0200
commitd035f4a3f3e73fd67d69a03c03adc9a08f30ef21 (patch)
tree52316988c7bcbd495ba4a53a337f7c9b3c813286 /src/modules/module-esound-sink.c
parent1c26d7e174ba54c062c0ae50d33bf4e819bb15ba (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-esound-sink.c')
-rw-r--r--src/modules/module-esound-sink.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c
index 5c47f444..a1a783aa 100644
--- a/src/modules/module-esound-sink.c
+++ b/src/modules/module-esound-sink.c
@@ -150,7 +150,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
case PA_SINK_RUNNING:
if (u->sink->thread_info.state == PA_SINK_SUSPENDED)
- pa_smoother_resume(u->smoother, pa_rtclock_usec());
+ pa_smoother_resume(u->smoother, pa_rtclock_usec(), TRUE);
break;
@@ -545,7 +545,14 @@ int pa__init(pa_module*m) {
u->module = m;
m->userdata = u;
u->fd = -1;
- 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,
+ 0,
+ FALSE);
pa_memchunk_reset(&u->memchunk);
u->offset = 0;