mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
pulse-server: fix channel_map check
We store the spa channel ids in the channel_map so convert them to pulseaudio ids before comparing them to the max pulseaudio id.
This commit is contained in:
parent
4c166709d0
commit
d03f29eb66
1 changed files with 2 additions and 1 deletions
|
|
@ -371,10 +371,11 @@ void channel_map_parse(const char *str, struct channel_map *map)
|
|||
bool channel_map_valid(const struct channel_map *map)
|
||||
{
|
||||
uint8_t i;
|
||||
uint32_t aux = 0;
|
||||
if (map->channels == 0 || map->channels > CHANNELS_MAX)
|
||||
return false;
|
||||
for (i = 0; i < map->channels; i++)
|
||||
if (map->map[i] >= CHANNEL_POSITION_MAX)
|
||||
if (channel_id2pa(map->map[i], &aux) >= CHANNEL_POSITION_MAX)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue