From c7b00599d7d32ef1df3f26ce44a65a4e60891c83 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Sat, 30 Sep 2023 11:05:11 +0300 Subject: [PATCH] scripts: remove 'active-features' session item constraints I don't fully remember where this originates from, but it looks like some sort of hack to workaround a race condition where the event handler would try to iterate over items that were just created and were not yet fully ready to be used. --- src/scripts/lib/linking-utils.lua | 3 --- src/scripts/linking/filter-forward-format.lua | 1 - 2 files changed, 4 deletions(-) diff --git a/src/scripts/lib/linking-utils.lua b/src/scripts/lib/linking-utils.lua index 0e101929..63114fa0 100644 --- a/src/scripts/lib/linking-utils.lua +++ b/src/scripts/lib/linking-utils.lua @@ -180,7 +180,6 @@ function putils.canLink (properties, si_target) for n in cutils.get_object_manager ("session-item"):iterate { type = "SiLinkable", Constraint { "item.factory.name", "c", "si-audio-adapter", "si-node" }, - Constraint { "active-features", "!", 0, type = "gobject" }, Constraint { "id", "!", si_target.id, type = "gobject" }, Constraint { "item.node.direction", "!", target_props ["item.node.direction"] }, Constraint { "node.link-group", "=", target_link_group }, @@ -196,7 +195,6 @@ function putils.canLink (properties, si_target) local peer = cutils.get_object_manager ("session-item"):lookup { type = "SiLinkable", Constraint { "item.factory.name", "c", "si-audio-adapter", "si-node" }, - Constraint { "active-features", "!", 0, type = "gobject" }, Constraint { "id", "=", peer_id, type = "gobject" }, } if peer and not canLinkGroupCheck (link_group, peer, hops + 1) then @@ -222,7 +220,6 @@ function putils.findDefaultLinkable (si) return cutils.get_object_manager ("session-item"):lookup { type = "SiLinkable", Constraint { "item.factory.name", "c", "si-audio-adapter", "si-node" }, - Constraint { "active-features", "!", 0, type = "gobject" }, Constraint { "node.id", "=", tostring (def_node_id) } } end diff --git a/src/scripts/linking/filter-forward-format.lua b/src/scripts/linking/filter-forward-format.lua index 0999111e..01d61d53 100644 --- a/src/scripts/linking/filter-forward-format.lua +++ b/src/scripts/linking/filter-forward-format.lua @@ -87,7 +87,6 @@ SimpleEventHook { Constraint { "event.session-item.interface", "=", "linkable" }, Constraint { "item.factory.name", "c", "si-audio-adapter", "si-node" }, Constraint { "media.class", "#", "Stream/*", type = "pw-global" }, - Constraint { "active-features", "!", 0, type = "gobject" }, }, }, execute = function (event)