policy-node: always up or downmix to device format

Always remix the channels to match the ones on the device even if
that means upmixing.

This will make mono streams go to all inputs of the device instead
of just one.

Fixes #355
This commit is contained in:
Wim Taymans 2020-11-04 09:47:20 +01:00
parent 4ea95abd90
commit 9d598cde63

View file

@ -158,13 +158,11 @@ static int configure_node(struct node *node, struct spa_audio_info *info, bool f
format = node->format;
if (info != NULL && info->info.raw.channels > 0) {
if (node->monitor || info->info.raw.channels < format.info.raw.channels) {
pw_log_info("node %d monitor:%d channelmix %d:%d",
pw_log_info("node %d monitor:%d channelmix %d->%d",
node->id, node->monitor, format.info.raw.channels,
info->info.raw.channels);
format = *info;
}
}
format.info.raw.rate = impl->sample_rate;
spa_pod_builder_init(&b, buf, sizeof(buf));