summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2020-07-27 17:41:52 +0200
committerWim Taymans <wtaymans@redhat.com>2020-07-27 17:41:52 +0200
commite35586cd15dbfb9bc5e2196e03373e5fec1c41c2 (patch)
tree0752bd76d8b89e1ec1642d7cf35bcb85f0253246
parent6e2d3feb077f3bc2ca8645e319f71d69808c4f21 (diff)
media-session: link MONO/UNKNOWN channels only once
Try to only link the MONO and UNKNOWN input ports once
-rw-r--r--src/examples/media-session/media-session.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/examples/media-session/media-session.c b/src/examples/media-session/media-session.c
index eaccc3aa..73cdac5c 100644
--- a/src/examples/media-session/media-session.c
+++ b/src/examples/media-session/media-session.c
@@ -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;
}