wireplumber/0006-policy-endpoint-client.lua-fix-record-with-endpoints.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

44 lines
1.7 KiB
Diff

From 2e23d827793e56655ffd6be39b377578cef21661 Mon Sep 17 00:00:00 2001
From: Ashok Sidipotu <ashok.sidipotu@collabora.com>
Date: Tue, 11 Jan 2022 15:31:40 +0530
Subject: [PATCH 06/14] policy-endpoint-client.lua: fix record with endpoints
The Role traversal of config data to take notice of the
media class as well so that source and sink roles dont
overstep on each other and pick up unexpected endpoints.
---
src/scripts/policy-endpoint-client.lua | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/scripts/policy-endpoint-client.lua b/src/scripts/policy-endpoint-client.lua
index 6b96edf..e898e35 100644
--- a/src/scripts/policy-endpoint-client.lua
+++ b/src/scripts/policy-endpoint-client.lua
@@ -37,10 +37,12 @@ function scheduleRescan ()
end
end
-function findRole(role)
+function findRole(role, tmc)
if role and not config.roles[role] then
for r, p in pairs(config.roles) do
- if type(p.alias) == "table" then
+ -- default media class can be overridden in the role config data
+ mc = p["media.class"] or "Audio/Sink"
+ if (type(p.alias) == "table" and tmc == mc) then
for i = 1, #(p.alias), 1 do
if role == p.alias[i] then
return r
@@ -69,7 +71,7 @@ function findTargetEndpoint (node, media_class)
end
-- find highest priority endpoint by role
- media_role = findRole(node.properties["media.role"])
+ media_role = findRole(node.properties["media.role"], target_media_class)
for si_target_ep in endpoints_om:iterate {
Constraint { "role", "=", media_role, type = "pw-global" },
Constraint { "media.class", "=", target_media_class, type = "pw-global" },
--
2.34.1