mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
pulse-server: convert channel_map channels
channel_map contains pulseaudio channel names, convert them to pipewire channel ids and then into pipewire channel names for the null sink.
This commit is contained in:
parent
1e89e7559b
commit
157d6de607
2 changed files with 24 additions and 1 deletions
|
|
@ -376,6 +376,19 @@ static inline void channel_map_to_positions(const struct channel_map *map, uint3
|
|||
pos[i] = map->map[i];
|
||||
}
|
||||
|
||||
static inline void channel_map_parse(const char *str, struct channel_map *map)
|
||||
{
|
||||
const char *p = str;
|
||||
size_t len;
|
||||
|
||||
while (*p && map->channels < SPA_AUDIO_MAX_CHANNELS) {
|
||||
if ((len = strcspn(p, ",")) == 0)
|
||||
break;
|
||||
map->map[map->channels++] = channel_paname2id(p, len);
|
||||
p += len + strspn(p+len, ",");
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool channel_map_valid(const struct channel_map *map)
|
||||
{
|
||||
uint8_t i;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue