mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-13 04:27:51 -05: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
|
|
@ -188,7 +188,7 @@ static void pw_properties_from_avahi_string(const char *key, const char *value,
|
|||
else if (spa_streq(key, "channel_map")) {
|
||||
struct channel_map channel_map;
|
||||
uint32_t i, pos[CHANNELS_MAX];
|
||||
char *p, *s;
|
||||
char *p, *s, buf[8];
|
||||
|
||||
spa_zero(channel_map);
|
||||
channel_map_parse(value, &channel_map);
|
||||
|
|
@ -198,7 +198,7 @@ static void pw_properties_from_avahi_string(const char *key, const char *value,
|
|||
p += spa_scnprintf(p, 2, "[");
|
||||
for (i = 0; i < channel_map.channels; i++)
|
||||
p += spa_scnprintf(p, 8, "%s%s", i == 0 ? "" : ",",
|
||||
channel_id2name(pos[i]));
|
||||
channel_id2name(pos[i], buf, sizeof(buf)));
|
||||
p += spa_scnprintf(p, 2, "]");
|
||||
pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue