mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-06-19 08:48:24 +02:00
device-profile-hooks: move the selected profile check
move the check to the beginning of the hook.
This commit is contained in:
parent
ad8d7aaf75
commit
112a45a230
2 changed files with 8 additions and 6 deletions
|
|
@ -21,6 +21,12 @@ SimpleEventHook {
|
|||
},
|
||||
execute = function (event)
|
||||
local selected_profile = event:get_data ("selected-profile")
|
||||
|
||||
-- skip hook if profile is already selected
|
||||
if selected_profile then
|
||||
return
|
||||
end
|
||||
|
||||
local device = event:get_subject ()
|
||||
local dev_name = device.properties["device.name"]
|
||||
local off_profile = nil
|
||||
|
|
@ -29,10 +35,6 @@ SimpleEventHook {
|
|||
-- Takes absolute priority if available or unknown
|
||||
local profile_prop = device.properties["device.profile"]
|
||||
|
||||
-- skip hook if profile is already selected
|
||||
if selected_profile then
|
||||
return
|
||||
end
|
||||
|
||||
for p in device:iterate_params ("EnumProfile") do
|
||||
profile = cutils.parseParam (p, "EnumProfile")
|
||||
|
|
|
|||
|
|
@ -28,14 +28,14 @@ find_stored_profile_hook = SimpleEventHook {
|
|||
},
|
||||
execute = function (event)
|
||||
local selected_profile = event:get_data ("selected-profile")
|
||||
local device = event:get_subject ()
|
||||
local dev_name = device.properties["device.name"]
|
||||
|
||||
-- skip hook if profile is already selected
|
||||
if selected_profile then
|
||||
return
|
||||
end
|
||||
|
||||
local device = event:get_subject ()
|
||||
local dev_name = device.properties["device.name"]
|
||||
if not dev_name then
|
||||
log:critical (device, "invalid device.name")
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue