mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-05 07:48:01 +02:00
policy-node: avoid searching for existing links if there is no reason
If the item was not already handled or if there is no target, we don't need to search for existing links... we will not find any Also, don't remove links or schedule rescan if the node is not eligible for reconnection... we will delete the node below instead
This commit is contained in:
parent
b27eccb9f0
commit
2a21e005e0
1 changed files with 18 additions and 14 deletions
|
|
@ -359,21 +359,25 @@ function handleLinkable (si)
|
|||
end
|
||||
|
||||
-- Check if item is linked to proper target, otherwise re-link
|
||||
local si_link, si_peer = getSiLinkAndSiPeer (si, si_props)
|
||||
if si_link then
|
||||
if si_peer and si_target and si_peer.id == si_target.id then
|
||||
Log.debug (si, "... already linked to proper target")
|
||||
return
|
||||
end
|
||||
if si_target and si_flags[si.id].was_handled then
|
||||
local si_link, si_peer = getSiLinkAndSiPeer (si, si_props)
|
||||
if si_link then
|
||||
if si_peer and si_peer.id == si_target.id then
|
||||
Log.debug (si, "... already linked to proper target")
|
||||
return
|
||||
end
|
||||
|
||||
-- only remove old link if active, otherwise schedule rescan
|
||||
if ((si_link:get_active_features() & Feature.SessionItem.ACTIVE) ~= 0) then
|
||||
si_link:remove ()
|
||||
Log.info (si, "... moving to new target")
|
||||
else
|
||||
pending_rescan = true
|
||||
Log.info (si, "... scheduled rescan")
|
||||
return
|
||||
if reconnect then
|
||||
-- remove old link if active, otherwise schedule rescan
|
||||
if ((si_link:get_active_features() & Feature.SessionItem.ACTIVE) ~= 0) then
|
||||
si_link:remove ()
|
||||
Log.info (si, "... moving to new target")
|
||||
else
|
||||
pending_rescan = true
|
||||
Log.info (si, "... scheduled rescan")
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue