acp: sync

This commit is contained in:
Wim Taymans 2020-10-13 17:23:36 +02:00
parent 4b7b2a9a10
commit 4e9b81960f
11 changed files with 28 additions and 12 deletions

View file

@ -1795,16 +1795,16 @@ static bool element_probe_volume(pa_alsa_element *e, snd_mixer_elem_t *me) {
alsa_id_str(buf, sizeof(buf), &e->alsa_id);
pa_log_warn("Volume element %s with no channels?", buf);
return false;
} else if (e->n_channels > 2) {
} else if (e->n_channels > 8) {
/* FIXME: In some places code like this is used:
*
* e->masks[alsa_channel_ids[p]][e->n_channels-1]
*
* The definition of e->masks is
*
* pa_channel_position_mask_t masks[SND_MIXER_SCHN_LAST + 1][2];
* pa_channel_position_mask_t masks[SND_MIXER_SCHN_LAST + 1][8];
*
* Since the array size is fixed at 2, we obviously
* Since the array size is fixed at 8, we obviously
* don't support elements with more than two
* channels... */
alsa_id_str(buf, sizeof(buf), &e->alsa_id);
@ -2464,7 +2464,7 @@ static pa_channel_position_mask_t parse_mask(const char *m) {
static int element_parse_override_map(pa_config_parser_state *state) {
pa_alsa_path *p;
pa_alsa_element *e;
const char *split_state = NULL;
const char *split_state = NULL, *s;
unsigned i = 0;
char *n;
@ -2490,12 +2490,18 @@ static int element_parse_override_map(pa_config_parser_state *state) {
}
}
if (pa_streq(state->lvalue, "override-map.1"))
e->masks[i++][0] = m;
else
e->masks[i++][1] = m;
s = strstr(state->lvalue, ".");
if (s) {
int idx;
pa_atoi(s + 1, &idx);
if (idx >= 1 && idx <= 8) {
e->masks[i++][idx-1] = m;
} else {
pa_log("[%s:%u] Override map index '%s' invalid in '%s'", state->filename, state->lineno, state->lvalue, state->section);
}
}
/* Later on we might add override-map.3 and so on here ... */
/* Later on we might add override-map.9 and so on here ... */
pa_xfree(n);
}
@ -2713,7 +2719,7 @@ static int path_verify(pa_alsa_path *p) {
{ "analog-input-microphone-rear", N_("Rear Microphone"), PA_DEVICE_PORT_TYPE_MIC },
{ "analog-input-microphone-dock", N_("Dock Microphone"), PA_DEVICE_PORT_TYPE_MIC },
{ "analog-input-microphone-internal", N_("Internal Microphone"), PA_DEVICE_PORT_TYPE_MIC },
{ "analog-input-microphone-headset", N_("Headset Microphone"), PA_DEVICE_PORT_TYPE_MIC },
{ "analog-input-microphone-headset", N_("Headset Microphone"), PA_DEVICE_PORT_TYPE_HEADSET },
{ "analog-input-linein", N_("Line In"), PA_DEVICE_PORT_TYPE_LINE },
{ "analog-input-radio", N_("Radio"), PA_DEVICE_PORT_TYPE_RADIO },
{ "analog-input-video", N_("Video"), PA_DEVICE_PORT_TYPE_VIDEO },
@ -2787,8 +2793,8 @@ pa_alsa_path* pa_alsa_path_new(const char *paths_dir, const char *fname, pa_alsa
{ "priority", pa_config_parse_unsigned, NULL, "General" },
{ "description-key", pa_config_parse_string, NULL, "General" },
{ "description", pa_config_parse_string, NULL, "General" },
{ "type", parse_type, NULL, "General" },
{ "mute-during-activation", pa_config_parse_bool, NULL, "General" },
{ "type", parse_type, NULL, "General" },
{ "eld-device", parse_eld_device, NULL, "General" },
/* [Option ...] */