https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4722#note_2940847 https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/889d069b4630ec6aa1e0f098ae575d8d625af2da From 889d069b4630ec6aa1e0f098ae575d8d625af2da Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 3 Jun 2025 10:50:10 +0200 Subject: [PATCH] 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 --- spa/plugins/audioconvert/audioadapter.c | 2 +- spa/plugins/videoconvert/videoadapter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index 95ec85e0dd..2e42b6f432 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -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); } diff --git a/spa/plugins/videoconvert/videoadapter.c b/spa/plugins/videoconvert/videoadapter.c index 5111b93801..5b101ff3d9 100644 --- a/spa/plugins/videoconvert/videoadapter.c +++ b/spa/plugins/videoconvert/videoadapter.c @@ -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); } -- GitLab