mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
core: cache requested latency only when we are running, not while we are still constructing
This commit is contained in:
parent
99a6a4742f
commit
8d9c26e3b6
2 changed files with 10 additions and 4 deletions
|
|
@ -1858,8 +1858,11 @@ pa_usec_t pa_sink_get_requested_latency_within_thread(pa_sink *s) {
|
|||
if (result != (pa_usec_t) -1)
|
||||
result = PA_CLAMP(result, s->thread_info.min_latency, s->thread_info.max_latency);
|
||||
|
||||
s->thread_info.requested_latency = result;
|
||||
s->thread_info.requested_latency_valid = TRUE;
|
||||
if (PA_SINK_IS_LINKED(s->thread_info.state)) {
|
||||
/* Only cache if properly initialized */
|
||||
s->thread_info.requested_latency = result;
|
||||
s->thread_info.requested_latency_valid = TRUE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1113,8 +1113,11 @@ pa_usec_t pa_source_get_requested_latency_within_thread(pa_source *s) {
|
|||
if (result != (pa_usec_t) -1)
|
||||
result = PA_CLAMP(result, s->thread_info.min_latency, s->thread_info.max_latency);
|
||||
|
||||
s->thread_info.requested_latency = result;
|
||||
s->thread_info.requested_latency_valid = TRUE;
|
||||
if (PA_SOURCE_IS_LINKED(s->thread_info.state)) {
|
||||
/* Only cache this if we are fully set up */
|
||||
s->thread_info.requested_latency = result;
|
||||
s->thread_info.requested_latency_valid = TRUE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue