pulse-server: use EnumFormat as fallback

Use a fixated format and position from EnumFormat as a fallback.
This commit is contained in:
Wim Taymans 2020-10-27 15:42:48 +01:00
parent 124b1221a6
commit 66cf4e68d5
3 changed files with 61 additions and 17 deletions

View file

@ -326,18 +326,19 @@ static int format_parse_param(const struct spa_pod *param, struct sample_spec *s
!SPA_AUDIO_FORMAT_IS_INTERLEAVED(info.info.raw.format)) {
return -ENOTSUP;
}
if (ss) {
ss->format = format_id2pa(info.info.raw.format);
if (ss->format == SAMPLE_INVALID)
return -ENOTSUP;
ss->format = format_id2pa(info.info.raw.format);
if (ss->format == SAMPLE_INVALID)
return -ENOTSUP;
ss->rate = info.info.raw.rate;
ss->channels = info.info.raw.channels;
map->channels = info.info.raw.channels;
for (i = 0; i < map->channels; i++)
map->map[i] = channel_id2pa(info.info.raw.position[i], &aux);
ss->rate = info.info.raw.rate;
ss->channels = info.info.raw.channels;
}
if (map) {
map->channels = info.info.raw.channels;
for (i = 0; i < map->channels; i++)
map->map[i] = channel_id2pa(info.info.raw.position[i], &aux);
}
return 0;
}