mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
spa: make a function to make a channel short name
Make a function that can generate and parse a short name for the positions that are not in the type list, like the AUX channels.
This commit is contained in:
parent
7177f8269d
commit
11f1298f53
16 changed files with 74 additions and 38 deletions
|
|
@ -86,11 +86,12 @@ static int position_to_string(struct channel_map *map, char *val, size_t len)
|
|||
{
|
||||
uint32_t i, o = 0;
|
||||
int r;
|
||||
char pos[8];
|
||||
o += snprintf(val, len, "[ ");
|
||||
for (i = 0; i < map->channels; i++) {
|
||||
r = snprintf(val+o, len-o, "%s%s", i == 0 ? "" : ", ",
|
||||
spa_debug_type_find_short_name(spa_type_audio_channel,
|
||||
map->pos[i]));
|
||||
spa_type_audio_channel_make_short_name(map->pos[i],
|
||||
pos, sizeof(pos), "UNK"));
|
||||
if (r < 0 || o + r >= len)
|
||||
return -ENOSPC;
|
||||
o += r;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue