mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-09 09:48:04 +02:00
suspend-node: check if the node still exists before suspending it
After a timeout, it's possible that something else may have destroyed the node already. This can happen for example with virtual sinks that were created from another process. Fixes: #467
This commit is contained in:
parent
a7b8966c06
commit
5d4db78427
1 changed files with 5 additions and 2 deletions
|
|
@ -38,8 +38,11 @@ om:connect("object-added", function (om, node)
|
|||
-- add idle timeout; multiply by 1000, timeout_add() expects ms
|
||||
sources[id] = Core.timeout_add(timeout * 1000, function()
|
||||
-- Suspend the node
|
||||
Log.info(node, "was idle for a while; suspending ...")
|
||||
node:send_command("Suspend")
|
||||
-- but check first if the node still exists
|
||||
if (node:get_active_features() & Feature.Proxy.BOUND) ~= 0 then
|
||||
Log.info(node, "was idle for a while; suspending ...")
|
||||
node:send_command("Suspend")
|
||||
end
|
||||
|
||||
-- Unref the source
|
||||
sources[id] = nil
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue