Commit 6395adb0 authored by Kimmo Lindholm's avatar Kimmo Lindholm

Sort sources first, sinks next

parent 8694653f
......@@ -734,6 +734,19 @@ static int audio_route_parser(struct userdata *u, DBusMessageIter *actit)
num_moving = pa_policy_group_start_move_all(u);
pa_log_debug("Policy groups moving: %d", num_moving);
/* Sort sources first, sinks next*/
for(i = 0; i < num_decisions - 1; i++)
{
int j = i+1;
while(j > i &&
decisions[i].class == pa_policy_route_to_sink && decisions[j].class == pa_policy_route_to_source) {
struct routing_decision tmp = decisions[i];
decisions[i] = decisions[j];
decisions[j] = tmp;
j--;
}
}
/* Set profiles and ports while the groups are detached. */
for (i = 0; i < num_decisions; i++) {
p = pa_proplist_new();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment