From 0bd64f17af89cb45e254add9108db66a53ad12b0 Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Thu, 2 May 2024 12:26:55 -0400 Subject: [PATCH] filter-utils: Check main filter nodes in a more robust way This patch makes the check more robust when detecting main filter nodes. This is because some filters might append '/Internal' to their main node media class. The direction check has also been improved to work with Video filters. --- src/scripts/lib/filter-utils.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/scripts/lib/filter-utils.lua b/src/scripts/lib/filter-utils.lua index 804c3ea1..edfdc6ab 100644 --- a/src/scripts/lib/filter-utils.lua +++ b/src/scripts/lib/filter-utils.lua @@ -306,14 +306,13 @@ local function rescanFilters (om, metadata_om) -- Only handle the main filter nodes filter.media_class = n.properties ["media.class"] - if filter.media_class ~= "Audio/Sink" and - filter.media_class ~= "Audio/Source" and - filter.media_class ~= "Video/Source" then + if string.find (filter.media_class, "Stream") then goto skip_linkable end -- Filter direction - if filter.media_class == "Audio/Sink" then + if string.find (filter.media_class, "Audio/Sink") or + string.find (filter.media_class, "Video/Sink") then filter.direction = "input" else filter.direction = "output"