policy-dsp: allow matching on all node properties

Prevously, we were only looking at node["global-properties"] for
properties to match on. Change this to instead run against
node.properties, so that we can use type-specific properties such as alsa.id.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
This commit is contained in:
James Calligeros
2024-03-26 19:14:05 +10:00
parent 3ffd0956d4
commit 62dd6effa8

View File

@@ -38,8 +38,8 @@ hidden_nodes = {}
nodes_om:connect("object-added", function (om, node)
for _, r in ipairs(config.rules or {}) do
for _, interest in ipairs(r.interests) do
if interest:matches(node["global-properties"]) then
local id = node["global-properties"]["object.id"]
if interest:matches(node.properties) then
local id = node.properties["object.id"]
if r.filter_chain then
if filter_chains[id] then
@@ -65,7 +65,7 @@ nodes_om:connect("object-added", function (om, node)
end)
nodes_om:connect("object-removed", function (om, node)
local id = node["global-properties"]["object.id"]
local id = node.properties["object.id"]
if filter_chains[id] then
Log.debug("Unloading filter chain associated with sink " .. id)
filter_chains[id] = nil