adapter: use the right default when filtering default

Before fixating the format, we try to add as many of the PortConfig
fields as we can as defaults. However, when we already have a property
that intersects, prefer to use the original negotiated one prefered by
the follower.

This got changed when the default for the pod filter changed to the
filter value.

The effect is, for example, when the follower asks for FL FR FC LFE SL
SR and the sink is using FL FR SL SR FC LFE, the PortConfig (and the
default) would then be FL FR SL SR FC LFE. After negotiation, we would
get FL FR FC LFE SL SR as the format but then with the filter and the
wrong default we would fixate to FL FR SL SR FC LFE, which does not
match what the follower wanted and either results in wrong channels
or an error of the follower.

See #4722
This commit is contained in:
Wim Taymans 2025-06-03 10:50:10 +02:00
parent 3f79bcae5d
commit 889d069b46
2 changed files with 2 additions and 2 deletions

View file

@ -904,7 +904,7 @@ static struct spa_pod *merge_objects(struct impl *this, struct spa_pod_builder *
p2 = spa_pod_object_find_prop(o2, p2, p1->key);
if (p2 != NULL) {
spa_pod_builder_get_state(b, &state);
res = spa_pod_filter_prop(b, p1, p2);
res = spa_pod_filter_prop(b, p2, p1);
if (res < 0)
spa_pod_builder_reset(b, &state);
}

View file

@ -871,7 +871,7 @@ static struct spa_pod *merge_objects(struct impl *this, struct spa_pod_builder *
p2 = spa_pod_object_find_prop(o2, p2, p1->key);
if (p2 != NULL) {
spa_pod_builder_get_state(b, &state);
res = spa_pod_filter_prop(b, p1, p2);
res = spa_pod_filter_prop(b, p2, p1);
if (res < 0)
spa_pod_builder_reset(b, &state);
}