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.
This commit is contained in:
Julian Bouzas
2024-05-02 12:26:55 -04:00
parent 709eecb21f
commit 0bd64f17af

View File

@@ -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"