mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
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:
parent
30d9b743a2
commit
6e6385e27d
1 changed files with 4 additions and 11 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue