mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
module-rescue-streams: Fixup previous patch w r t fallback sink/sources
- Make sure "no evacuation sink/source found" is not printed when fallback source/sink is selected - Restore previous behaviour of fallback sink/source selected (first one instead of last one) Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
618a2167f7
commit
38c5d6d585
1 changed files with 16 additions and 10 deletions
|
|
@ -126,7 +126,8 @@ static pa_sink* find_evacuation_sink(pa_core *c, pa_sink_input *i, pa_sink *skip
|
|||
if (!pa_sink_input_may_move_to(i, target))
|
||||
continue;
|
||||
|
||||
fb_sink = target;
|
||||
if (!fb_sink)
|
||||
fb_sink = target;
|
||||
|
||||
build_group_ports(all_ports, target->ports);
|
||||
}
|
||||
|
|
@ -135,11 +136,13 @@ static pa_sink* find_evacuation_sink(pa_core *c, pa_sink_input *i, pa_sink *skip
|
|||
|
||||
pa_hashmap_free(all_ports);
|
||||
|
||||
if(!best_port) {
|
||||
pa_log_debug("No evacuation sink found.");
|
||||
if (best_port)
|
||||
target = find_sink_from_port(c, best_port);
|
||||
else
|
||||
target = fb_sink;
|
||||
} else
|
||||
target = find_sink_from_port(c, best_port);
|
||||
|
||||
if (!target)
|
||||
pa_log_debug("No evacuation sink found.");
|
||||
|
||||
return target;
|
||||
}
|
||||
|
|
@ -234,7 +237,8 @@ static pa_source* find_evacuation_source(pa_core *c, pa_source_output *o, pa_sou
|
|||
if (!pa_source_output_may_move_to(o, target))
|
||||
continue;
|
||||
|
||||
fb_source = target;
|
||||
if (!fb_source)
|
||||
fb_source = target;
|
||||
|
||||
build_group_ports(all_ports, target->ports);
|
||||
}
|
||||
|
|
@ -243,11 +247,13 @@ static pa_source* find_evacuation_source(pa_core *c, pa_source_output *o, pa_sou
|
|||
|
||||
pa_hashmap_free(all_ports);
|
||||
|
||||
if(!best_port) {
|
||||
pa_log_debug("No evacuation source found.");
|
||||
target = fb_source;
|
||||
} else
|
||||
if (best_port)
|
||||
target = find_source_from_port(c, best_port);
|
||||
else
|
||||
target = fb_source;
|
||||
|
||||
if (!target)
|
||||
pa_log_debug("No evacuation source found.");
|
||||
|
||||
return target;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue