acp: don't mix non-AUX and AUX channels

When filling up the channels, either fill up the positions with one
of the know layouts or use AUX channels, never try to mix them.

This avoid cards with a large number channels to show a strange mix
of surround and AUX channels.
This commit is contained in:
Wim Taymans 2022-06-02 12:54:04 +02:00
parent 30d9b743a2
commit 6e6385e27d

View file

@ -196,17 +196,10 @@ static inline pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsign
static inline pa_channel_map* pa_channel_map_init_extend(pa_channel_map *m, static inline pa_channel_map* pa_channel_map_init_extend(pa_channel_map *m,
unsigned channels, pa_channel_map_def_t def) unsigned channels, pa_channel_map_def_t def)
{ {
unsigned i, c; pa_channel_map *r;
pa_channel_map_init(m); if ((r = pa_channel_map_init_auto(m, channels, def)) != NULL)
for (c = channels; c > 0; c--) { return r;
if (pa_channel_map_init_auto(m, c, def) == NULL) return pa_channel_map_init_auto(m, channels, PA_CHANNEL_MAP_AUX);
continue;
for (i = 0; c < channels; c++, i++)
m->map[c] = PA_CHANNEL_POSITION_AUX0 + (i & 31);
m->channels = (uint8_t) channels;
return m;
}
return NULL;
} }
typedef uint64_t pa_channel_position_mask_t; typedef uint64_t pa_channel_position_mask_t;