mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
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.
This commit is contained in:
parent
1c26d7e174
commit
d035f4a3f3
12 changed files with 136 additions and 43 deletions
|
|
@ -664,7 +664,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
|
|||
if (PA_PTR_TO_UINT(data) == PA_SINK_SUSPENDED)
|
||||
pa_smoother_pause(u->thread_info.smoother, pa_rtclock_usec());
|
||||
else
|
||||
pa_smoother_resume(u->thread_info.smoother, pa_rtclock_usec());
|
||||
pa_smoother_resume(u->thread_info.smoother, pa_rtclock_usec(), TRUE);
|
||||
|
||||
break;
|
||||
|
||||
|
|
@ -1043,7 +1043,14 @@ int pa__init(pa_module*m) {
|
|||
pa_atomic_store(&u->thread_info.running, FALSE);
|
||||
u->thread_info.in_null_mode = FALSE;
|
||||
u->thread_info.counter = 0;
|
||||
u->thread_info.smoother = pa_smoother_new(PA_USEC_PER_SEC, PA_USEC_PER_SEC*2, TRUE, 10);
|
||||
u->thread_info.smoother = pa_smoother_new(
|
||||
PA_USEC_PER_SEC,
|
||||
PA_USEC_PER_SEC*2,
|
||||
TRUE,
|
||||
TRUE,
|
||||
10,
|
||||
0,
|
||||
FALSE);
|
||||
|
||||
if (pa_modargs_get_value_u32(ma, "adjust_time", &u->adjust_time) < 0) {
|
||||
pa_log("Failed to parse adjust_time value");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue