mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-14 11:08:10 +02:00
parent
7c1fc1c567
commit
20c7733640
3 changed files with 14 additions and 10 deletions
|
|
@ -134,8 +134,8 @@ function createNode(parent, id, type, factory, properties)
|
|||
or dev_props["device.nick"]
|
||||
or dev_props["api.alsa.card.name"]
|
||||
or dev_props["alsa.card_name"]
|
||||
-- also sanitize nick, but allow all characters except :
|
||||
properties["node.nick"] = nick:gsub("(:)", "_")
|
||||
-- also sanitize nick, replace ':' with ' '
|
||||
properties["node.nick"] = nick:gsub("(:)", " ")
|
||||
|
||||
-- ensure the node has a description
|
||||
if not properties["node.description"] then
|
||||
|
|
@ -143,14 +143,15 @@ function createNode(parent, id, type, factory, properties)
|
|||
local name = properties["api.alsa.pcm.name"] or properties["api.alsa.pcm.id"] or dev
|
||||
|
||||
if profile_desc then
|
||||
properties["node.description"] = desc .. " " .. profile_desc
|
||||
desc = desc .. " " .. profile_desc
|
||||
elseif subdev == "0" then
|
||||
properties["node.description"] = desc .. " (" .. name .. " " .. subdev .. ")"
|
||||
desc = desc .. " (" .. name .. " " .. subdev .. ")"
|
||||
elseif dev == "0" then
|
||||
properties["node.description"] = desc .. " (" .. name .. ")"
|
||||
else
|
||||
properties["node.description"] = desc
|
||||
desc = desc .. " (" .. name .. ")"
|
||||
end
|
||||
|
||||
-- also sanitize description, replace ':' with ' '
|
||||
properties["node.description"] = desc:gsub("(:)", " ")
|
||||
end
|
||||
|
||||
-- apply properties from config.rules
|
||||
|
|
|
|||
|
|
@ -48,12 +48,14 @@ function createNode(parent, id, type, factory, properties)
|
|||
properties["node.pause-on-idle"] = false
|
||||
|
||||
-- set the node description
|
||||
properties["node.description"] =
|
||||
local desc =
|
||||
dev_props["device.description"]
|
||||
or dev_props["device.name"]
|
||||
or dev_props["device.nick"]
|
||||
or dev_props["device.alias"]
|
||||
or "bluetooth-device"
|
||||
-- sanitize description, replace ':' with ' '
|
||||
properties["node.description"] = desc:gsub("(:)", " ")
|
||||
|
||||
-- set the node name
|
||||
local name =
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ function createNode(parent, id, type, factory, properties)
|
|||
dev_props["device.nick"] or
|
||||
dev_props["device.alias"] or
|
||||
"v4l2-device")
|
||||
|
||||
-- sanitize name
|
||||
name = name:gsub("([^%w_%-%.])", "_")
|
||||
|
||||
|
|
@ -83,7 +82,9 @@ function createNode(parent, id, type, factory, properties)
|
|||
end
|
||||
|
||||
-- set the node description
|
||||
properties["node.description"] = dev_props["device.description"] or "v4l2-device"
|
||||
local desc = dev_props["device.description"] or "v4l2-device"
|
||||
-- sanitize description, replace ':' with ' '
|
||||
properties["node.description"] = desc:gsub("(:)", " ")
|
||||
|
||||
-- apply properties from config.rules
|
||||
rulesApplyProperties(properties)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue