mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
spa: add spa_audio_parse_position_n
Add a function that accepts the size of the position array when reading the audio positions. This makes it possible to decouple the position array size from SPA_AUDIO_MAX_CHANNELS. Also use SPA_N_ELEMENTS to pass the number of array elements to functions instead of a fixed constant. This makes it easier to change the array size later to a different constant without having to patch up all the places where the size is used.
This commit is contained in:
parent
9e7cae13df
commit
8bbca3b8f3
27 changed files with 84 additions and 63 deletions
|
|
@ -704,7 +704,8 @@ static int parse_channelmap(const char *channel_map, struct channelmap *map)
|
|||
}
|
||||
}
|
||||
|
||||
spa_audio_parse_position(channel_map, strlen(channel_map), map->channels, &map->n_channels);
|
||||
spa_audio_parse_position_n(channel_map, strlen(channel_map),
|
||||
map->channels, SPA_N_ELEMENTS(map->channels), &map->n_channels);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue