media-session: fix aux channels links

AUX channels can link to any other channel but when AUX channels are
linked, they must match exactly.

Fixes some issues with split devices with aux channels.
This commit is contained in:
Wim Taymans 2021-10-11 11:35:29 +02:00
parent 594f67ec04
commit 036371c48f

View file

@ -1816,12 +1816,12 @@ static int score_ports(struct sm_port *out, struct sm_port *in)
(out->channel == SPA_AUDIO_CHANNEL_MONO && in->channel == SPA_AUDIO_CHANNEL_FC)) (out->channel == SPA_AUDIO_CHANNEL_MONO && in->channel == SPA_AUDIO_CHANNEL_FC))
score += 50; score += 50;
else if (in->channel == SPA_AUDIO_CHANNEL_UNKNOWN || else if (in->channel == SPA_AUDIO_CHANNEL_UNKNOWN ||
channel_is_aux(in->channel) ||
in->channel == SPA_AUDIO_CHANNEL_MONO || in->channel == SPA_AUDIO_CHANNEL_MONO ||
out->channel == SPA_AUDIO_CHANNEL_UNKNOWN || out->channel == SPA_AUDIO_CHANNEL_UNKNOWN ||
channel_is_aux(out->channel) ||
out->channel == SPA_AUDIO_CHANNEL_MONO) out->channel == SPA_AUDIO_CHANNEL_MONO)
score += 10; score += 10;
else if (channel_is_aux(in->channel) != channel_is_aux(out->channel))
score += 7;
if (score > 0 && !in->visited) if (score > 0 && !in->visited)
score += 5; score += 5;
if (score <= 10) if (score <= 10)