media-session: link MONO/UNKNOWN channels only once

Try to only link the MONO and UNKNOWN input ports once
This commit is contained in:
Wim Taymans 2020-07-27 17:41:52 +02:00
parent 6e2d3feb07
commit e35586cd15

View file

@ -1517,16 +1517,15 @@ static int score_ports(struct sm_port *out, struct sm_port *in)
else if ((out->channel == SPA_AUDIO_CHANNEL_FC && in->channel == SPA_AUDIO_CHANNEL_MONO) ||
(out->channel == SPA_AUDIO_CHANNEL_MONO && in->channel == SPA_AUDIO_CHANNEL_FC))
score += 50;
else if (in->channel == SPA_AUDIO_CHANNEL_UNKNOWN)
score += 40;
else if (in->channel == SPA_AUDIO_CHANNEL_MONO)
score += 30;
else if (out->channel == SPA_AUDIO_CHANNEL_UNKNOWN)
score += 20;
else if (out->channel == SPA_AUDIO_CHANNEL_MONO)
else if (in->channel == SPA_AUDIO_CHANNEL_UNKNOWN ||
in->channel == SPA_AUDIO_CHANNEL_MONO ||
out->channel == SPA_AUDIO_CHANNEL_UNKNOWN ||
out->channel == SPA_AUDIO_CHANNEL_MONO)
score += 10;
if (score > 0 && !in->visited)
score += 5;
if (score <= 10)
score = 0;
return score;
}