modules: add various checks to avoid selecting objects that are not linked or in another unclear state

This commit is contained in:
Lennart Poettering 2009-08-16 00:45:23 +02:00
parent 2a39663ab6
commit 4c29ba9c33
4 changed files with 92 additions and 16 deletions

View file

@ -71,6 +71,9 @@ static pa_sink* find_evacuation_sink(pa_core *c, pa_sink_input *i, pa_sink *skip
if (target == skip)
continue;
if (!PA_SINK_IS_LINKED(pa_sink_get_state(target)))
continue;
if (pa_sink_input_may_move_to(i, target))
return target;
}
@ -159,6 +162,9 @@ static pa_source* find_evacuation_source(pa_core *c, pa_source_output *o, pa_sou
if (!target->monitor_of != !skip->monitor_of)
continue;
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(target)))
continue;
if (pa_source_output_may_move_to(o, target))
return target;
}