wireplumber/0002-policy-node-schedule-a-rescan-without-timeout-if-def.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

49 lines
1.6 KiB
Diff

From afe71d7e48c28b0ae5cbd9327433e3c55c103fcb Mon Sep 17 00:00:00 2001
From: Julian Bouzas <julian.bouzas@collabora.com>
Date: Thu, 6 Jan 2022 10:53:38 -0500
Subject: [PATCH 02/14] policy-node: schedule a rescan without timeout if
defined target is not found
Fixes #146
---
src/scripts/policy-node.lua | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/src/scripts/policy-node.lua b/src/scripts/policy-node.lua
index 8ca5a69..c273c1f 100644
--- a/src/scripts/policy-node.lua
+++ b/src/scripts/policy-node.lua
@@ -552,25 +552,16 @@ function handleLinkable (si)
si_target = nil
end
- -- wait up to 2 seconds for the requested target to become available
- -- this is because the client may have already "seen" a target that we haven't
- -- yet prepared, which leads to a race condition
+ -- if the client has seen a target that we haven't yet prepared, schedule
+ -- a rescan one more time and hope for the best
local si_id = si.id
if si_props["node.target"] and si_props["node.target"] ~= "-1"
and not si_target
and not si_flags[si_id].was_handled
and not si_flags[si_id].done_waiting then
- if not si_flags[si_id].timeout_source then
- si_flags[si_id].timeout_source = Core.timeout_add(2000, function()
- if si_flags[si_id] then
- si_flags[si_id].done_waiting = true
- si_flags[si_id].timeout_source = nil
- scheduleRescan()
- end
- return false
- end)
- end
Log.info (si, "... waiting for target")
+ si_flags[si_id].done_waiting = true
+ scheduleRescan()
return
end
--
2.34.1