pulse-server: use PipeWire format and channel names

Use the PipeWire format and channel names in the config to avoid
confusion.
This commit is contained in:
Wim Taymans 2021-04-09 11:30:57 +02:00
parent b305f57e4d
commit 44e6e7f5c8
3 changed files with 32 additions and 6 deletions

View file

@ -117,6 +117,15 @@ static inline const char *format_id2name(uint32_t format)
}
return "UNKNOWN";
}
static inline uint32_t format_name2id(const char *name)
{
int i;
for (i = 0; spa_type_audio_format[i].name; i++) {
if (strcmp(name, spa_debug_type_short_name(spa_type_audio_format[i].name)) == 0)
return spa_type_audio_format[i].type;
}
return SPA_AUDIO_CHANNEL_UNKNOWN;
}
static inline uint32_t format_paname2id(const char *name, size_t size)
{