l/find-best-target: Allow regular filters to be best targets

Similar to 4868b3c3 and fa671216, we always want to treat regular filters as
normal stream/device nodes.
This commit is contained in:
Julian Bouzas 2024-06-27 10:14:48 -04:00 committed by George Kiagiadakis
parent fe42d931da
commit 96dc045382
2 changed files with 6 additions and 2 deletions

View file

@ -579,6 +579,7 @@ wireplumber.components = [
{ {
name = linking/find-best-target.lua, type = script/lua name = linking/find-best-target.lua, type = script/lua
provides = hooks.linking.target.find-best provides = hooks.linking.target.find-best
requires = [ metadata.filters ]
} }
{ {
name = linking/get-filter-from-target.lua, type = script/lua name = linking/get-filter-from-target.lua, type = script/lua

View file

@ -8,6 +8,7 @@
lutils = require ("linking-utils") lutils = require ("linking-utils")
cutils = require ("common-utils") cutils = require ("common-utils")
futils = require ("filter-utils")
log = Log.open_topic ("s-linking") log = Log.open_topic ("s-linking")
SimpleEventHook { SimpleEventHook {
@ -52,8 +53,10 @@ SimpleEventHook {
tostring (target_props ["node.name"]), tostring (target_props ["node.name"]),
tostring (target_node_id))) tostring (target_node_id)))
if si_target_link_group ~= nil then -- Skip smart filters as best target
Log.debug ("... ignoring filter as best target") if si_target_link_group ~= nil and
futils.is_filter_smart (target_direction, si_target_link_group) then
Log.debug ("... ignoring smart filter as best target")
goto skip_linkable goto skip_linkable
end end