mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: libcamera: source: prop_id_to_control(): do range check first
If it is a custom spa property, it will not be found in the lookup
table, so we can return immediately.
(cherry picked from commit 30ce210c2a)
This commit is contained in:
parent
b775acca60
commit
a080a4a6f2
1 changed files with 3 additions and 3 deletions
|
|
@ -744,14 +744,14 @@ uint32_t control_to_prop_id(uint32_t control_id)
|
|||
|
||||
uint32_t prop_id_to_control(uint32_t prop_id)
|
||||
{
|
||||
if (prop_id >= SPA_PROP_START_CUSTOM)
|
||||
return prop_id - SPA_PROP_START_CUSTOM;
|
||||
|
||||
for (const auto& c : control_map) {
|
||||
if (c.spa_id == prop_id)
|
||||
return c.id;
|
||||
}
|
||||
|
||||
if (prop_id >= SPA_PROP_START_CUSTOM)
|
||||
return prop_id - SPA_PROP_START_CUSTOM;
|
||||
|
||||
return SPA_ID_INVALID;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue