mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-03-07 14:40:33 +01:00
policy-device-profile: set default and best by device.profile
This commit is contained in:
parent
2970ee2634
commit
5faab4e8c2
1 changed files with 5 additions and 6 deletions
|
|
@ -90,13 +90,17 @@ function findDefaultProfile (device)
|
|||
end
|
||||
|
||||
function findBestProfile (device)
|
||||
-- Takes absolute priority if available or unknown
|
||||
local profile_prop = device.properties["device.profile"]
|
||||
local off_profile = nil
|
||||
local best_profile = nil
|
||||
local unk_profile = nil
|
||||
|
||||
for p in device:iterate_params("EnumProfile") do
|
||||
profile = parseParam(p, "EnumProfile")
|
||||
if profile and profile.name ~= "pro-audio" then
|
||||
if profile and profile.name == profile_prop and profile.available ~= "no" then
|
||||
return profile
|
||||
elseif profile and profile.name ~= "pro-audio" then
|
||||
if profile.name == "off" then
|
||||
off_profile = profile
|
||||
elseif profile.available == "yes" then
|
||||
|
|
@ -152,11 +156,6 @@ function handleProfiles (device, new_device)
|
|||
Log.info ("Default profile not found for " .. dev_name)
|
||||
end
|
||||
|
||||
-- Do not set best profile if device.profile has been set
|
||||
if device.properties["device.profile"] ~= nil then
|
||||
return
|
||||
end
|
||||
|
||||
local best_profile = findBestProfile (device)
|
||||
if best_profile ~= nil then
|
||||
Log.info ("Found best profile " .. best_profile.name .. " for " .. dev_name)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue