mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-01-09 10:40:14 +01:00
policy-node: handle WpSiStandardLink link-error signal
It gets emitted e.g. on format negotiation errors. Send `-EPIPE` errors to the respective clients to let them close the connection.
This commit is contained in:
parent
04bf9b013e
commit
b8201d2716
1 changed files with 20 additions and 0 deletions
|
|
@ -98,6 +98,26 @@ function createLink (si, si_target, passthrough, exclusive)
|
|||
return
|
||||
end
|
||||
|
||||
si_link:connect("link-error", function (_, error_msg)
|
||||
Log.info (si_link, "got link-error signal: " .. error_msg)
|
||||
|
||||
local n1 = si:get_associated_proxy ("node")
|
||||
local n2 = si_target:get_associated_proxy ("node")
|
||||
|
||||
for _, node in ipairs ({n1, n2}) do
|
||||
local client_id = node.properties["client.id"]
|
||||
if client_id then
|
||||
local client = clients_om:lookup {
|
||||
Constraint { "bound-id", "=", client_id, type = "gobject" }
|
||||
}
|
||||
if client then
|
||||
Log.info (node, "sending client error")
|
||||
client:send_error(node["bound-id"], -32, error_msg)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- register
|
||||
si_flags[si_id].peer_id = si_target.id
|
||||
si_flags[si_id].failed_peer_id = si_target.id
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue