mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-16 06:59:55 -05:00
alsa-mixer: Handle the index for ALSA mixer jack identifiers
Some systems have two jacks with same name but different index, we need to take index into consideration to use both jacks. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/272>
This commit is contained in:
parent
0f89157261
commit
8903d2ccc0
6 changed files with 73 additions and 58 deletions
|
|
@ -621,6 +621,7 @@ static void init_jacks(struct userdata *u) {
|
|||
void *state;
|
||||
pa_alsa_path* path;
|
||||
pa_alsa_jack* jack;
|
||||
char buf[64];
|
||||
|
||||
u->jacks = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
|
||||
|
||||
|
|
@ -663,9 +664,10 @@ static void init_jacks(struct userdata *u) {
|
|||
}
|
||||
}
|
||||
pa_alsa_mixer_set_fdlist(u->mixers, jack->mixer_handle, u->core->mainloop);
|
||||
jack->melem = pa_alsa_mixer_find_card(jack->mixer_handle, jack->alsa_name, 0);
|
||||
jack->melem = pa_alsa_mixer_find_card(jack->mixer_handle, &jack->alsa_id, 0);
|
||||
if (!jack->melem) {
|
||||
pa_log_warn("Jack '%s' seems to have disappeared.", jack->alsa_name);
|
||||
pa_alsa_mixer_id_to_string(buf, sizeof(buf), &jack->alsa_id);
|
||||
pa_log_warn("Jack %s seems to have disappeared.", buf);
|
||||
pa_alsa_jack_set_has_control(jack, false);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue