mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
combine-sink: Make the latency range calculation easier to read
I think this is much easier to understand. This should not result in any functional change.
This commit is contained in:
parent
23f120aabb
commit
ddec7e1080
1 changed files with 10 additions and 5 deletions
|
|
@ -732,15 +732,20 @@ static void update_latency_range(struct userdata *u) {
|
|||
max_latency = max;
|
||||
}
|
||||
if (max_latency == (pa_usec_t) -1) {
|
||||
/* no outputs, use block size */
|
||||
/* No outputs, use default limits. */
|
||||
min_latency = u->default_min_latency;
|
||||
max_latency = u->default_max_latency;
|
||||
}
|
||||
else if (max_latency < min_latency)
|
||||
max_latency = min_latency;
|
||||
|
||||
/* never go below the min_latency or BLOCK_USEC */
|
||||
max_latency = MIN (max_latency, MAX (min_latency, BLOCK_USEC));
|
||||
/* As long as we don't support rewinding, we should limit the max latency
|
||||
* to a conservative value. */
|
||||
if (max_latency > u->default_max_latency)
|
||||
max_latency = u->default_max_latency;
|
||||
|
||||
/* Never ever try to set lower max latency than min latency, it just
|
||||
* doesn't make sense. */
|
||||
if (max_latency < min_latency)
|
||||
max_latency = min_latency;
|
||||
|
||||
pa_log_debug("Sink update latency range %lu %lu", min_latency, max_latency);
|
||||
pa_sink_set_latency_range_within_thread(u->sink, min_latency, max_latency);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue