diff options
author | David Henningsson <david.henningsson@canonical.com> | 2014-06-10 08:30:05 +0200 |
---|---|---|
committer | David Henningsson <david.henningsson@canonical.com> | 2014-06-10 08:30:05 +0200 |
commit | 38c5d6d585f588665280df3cecc2ea68a2dcd807 (patch) | |
tree | c67c0f22aa12435aa6f775013a79c15bbfaa2fa3 | |
parent | 618a2167f7e5c5e03bd893be7dea2aaa5ff5529f (diff) |
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>
-rw-r--r-- | src/modules/module-rescue-streams.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/modules/module-rescue-streams.c b/src/modules/module-rescue-streams.c index 265711c15..f456be0fc 100644 --- a/src/modules/module-rescue-streams.c +++ b/src/modules/module-rescue-streams.c @@ -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; } |