mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-04-21 12:30:40 +02:00
autoswitch-bluetooth-profile: Don't evaluate if node state changes from 'idle' to 'suspended'
This is not needed and can improve performance a little bit.
This commit is contained in:
parent
8dcf3ce6ed
commit
9fb963d4e5
1 changed files with 11 additions and 0 deletions
|
|
@ -455,6 +455,17 @@ local state_changed_hook = SimpleEventHook {
|
|||
},
|
||||
execute = function (event)
|
||||
local source = event:get_source ()
|
||||
local node = event:get_subject ()
|
||||
local old_state = event:get_properties ()["event.subject.old-state"]
|
||||
local new_state = event:get_properties ()["event.subject.new-state"]
|
||||
|
||||
log:info (node, "state changed from '" .. old_state .. "' to '" .. new_state .. "'")
|
||||
|
||||
-- Dont evaluate if the state changed from idle to suspended
|
||||
if old_state == "idle" and new_state == "suspended" then
|
||||
return
|
||||
end
|
||||
|
||||
source:call ("push-event", "evaluate-bluetooth-profiles", nil, nil)
|
||||
end
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue