wireplumber/0003-policy-node-find-best-linkable-if-default-one-cannot.patch
Antonio Larrosa 23c5d9eadf Accepting request 948445 from home:alarrosa:branches:multimedia:libs
- Back to version 0.4.6, and add patches incrementally
  to bisect it and find the issue
  * 0001-policy-node-fix-typo-when-finding-best-target.patch
  * 0002-policy-node-schedule-a-rescan-without-timeout-if-def.patch
  * 0003-policy-node-find-best-linkable-if-default-one-cannot.patch
  * 0004-spa-pod-fix-different-architecture-errors-for-boolea.patch
  * 0005-config-update-the-endpoints-config.patch
  * 0006-policy-endpoint-client.lua-fix-record-with-endpoints.patch
  * 0007-default-nodes-check-if-the-ports-exist-in-rescan_om.patch
  * 0008-scripts-monitors-log-warning-if-spa-devices-were-not.patch
- Remove revert from previous change:
  * 0001-reversed-default-nodes-check-if-default-node-has-available-ro.patch

OBS-URL: https://build.opensuse.org/request/show/948445
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=24
2022-01-24 16:17:22 +00:00

47 lines
1.5 KiB
Diff

From bee9827ae376b75feceea926b0afc727fecca51b Mon Sep 17 00:00:00 2001
From: Julian Bouzas <julian.bouzas@collabora.com>
Date: Fri, 7 Jan 2022 15:35:10 -0500
Subject: [PATCH 03/14] policy-node: find best linkable if default one cannot
be linked
Fixes issue with echo cancellation pipewire module.
---
src/scripts/policy-node.lua | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/scripts/policy-node.lua b/src/scripts/policy-node.lua
index c273c1f..9df5007 100644
--- a/src/scripts/policy-node.lua
+++ b/src/scripts/policy-node.lua
@@ -477,13 +477,22 @@ function findBestLinkable (si)
end
function findUndefinedTarget (si)
- -- Find the default linkable if the default nodes module is loaded, otherwise
- -- just find the best linkable based on priority and routes
- if default_nodes ~= nil then
- return findDefaultlinkable (si)
- else
+ -- Just find the best linkable if default nodes module is not loaded
+ if default_nodes == nil then
return findBestLinkable (si)
end
+
+ -- Otherwise find the default linkable. If the default linkabke cannot link,
+ -- we find the best one instead. We return nil if default does not exist.
+ local si_target, can_passthrough = findDefaultlinkable (si)
+ if si_target then
+ if canLink (si.properties, si_target) then
+ return si_target, can_passthrough
+ else
+ return findBestLinkable (si)
+ end
+ end
+ return nil, nil
end
function lookupLink (si_id, si_target_id)
--
2.34.1