mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
json: add helper function to parse channel positions
Use the helper instead of duplicating the same code. Also add some helpers to parse a json array of uint32_t Move some functions to convert between type name and id.
This commit is contained in:
parent
911a601b95
commit
e2991f6398
34 changed files with 256 additions and 791 deletions
|
|
@ -502,12 +502,7 @@ static void get_channels(struct spa_bt_transport *t, bool a2dp_duplex, uint32_t
|
|||
|
||||
static const char *get_channel_name(uint32_t channel)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; spa_type_audio_channel[i].name; i++) {
|
||||
if (spa_type_audio_channel[i].type == channel)
|
||||
return spa_debug_type_short_name(spa_type_audio_channel[i].name);
|
||||
}
|
||||
return NULL;
|
||||
return spa_type_to_short_name(channel, spa_type_audio_channel, NULL);
|
||||
}
|
||||
|
||||
static int channel_position_cmp(const void *pa, const void *pb)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue