mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-03-02 01:40:27 -05:00
core: introduce pa_{sink,source}_set_fixed_latency()
This allows us to forward the fixed latency directly from the sink to the monitor source withut having to wait for pa_sink_put().
This commit is contained in:
parent
92a6141888
commit
3766850c8b
11 changed files with 48 additions and 16 deletions
|
|
@ -2050,6 +2050,22 @@ void pa_sink_set_latency_range_within_thread(pa_sink *s, pa_usec_t min_latency,
|
|||
pa_source_set_latency_range_within_thread(s->monitor_source, min_latency, max_latency);
|
||||
}
|
||||
|
||||
/* Called from main thread, before the sink is put */
|
||||
void pa_sink_set_fixed_latency(pa_sink *s, pa_usec_t latency) {
|
||||
pa_sink_assert_ref(s);
|
||||
|
||||
pa_assert(pa_sink_get_state(s) == PA_SINK_INIT);
|
||||
|
||||
if (latency < ABSOLUTE_MIN_LATENCY)
|
||||
latency = ABSOLUTE_MIN_LATENCY;
|
||||
|
||||
if (latency > ABSOLUTE_MAX_LATENCY)
|
||||
latency = ABSOLUTE_MAX_LATENCY;
|
||||
|
||||
s->fixed_latency = latency;
|
||||
pa_source_set_fixed_latency(s->monitor_source, latency);
|
||||
}
|
||||
|
||||
/* Called from main context */
|
||||
size_t pa_sink_get_max_rewind(pa_sink *s) {
|
||||
size_t r;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue