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:
Wim Taymans 2024-09-18 09:54:34 +02:00
parent 911a601b95
commit e2991f6398
34 changed files with 256 additions and 791 deletions

View file

@ -772,7 +772,7 @@ static int snd_pcm_pipewire_hw_params(snd_pcm_ioplug_t * io,
pw->requested.info.raw.channels = io->channels;
pw->requested.info.raw.rate = io->rate;
set_default_channels(io->channels, pw->requested.info.raw.position);
fmt_str = spa_debug_type_find_name(spa_type_audio_format, pw->requested.info.raw.format);
fmt_str = spa_type_audio_format_to_short_name(pw->requested.info.raw.format);
pw->format = pw->requested;
break;
case SPA_MEDIA_SUBTYPE_dsd: