alsa-mixer: Set mdev to NULL if there is no mapping

We check if mapping is NULL but if so we never set mdev, set it to NULL as well.

Fixes: 79cb1369fc
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/615>
This commit is contained in:
Igor V. Kovalenko 2021-08-06 22:26:40 +03:00
parent da60f8af1d
commit 49b07edcaf
2 changed files with 2 additions and 4 deletions

View file

@ -2121,8 +2121,7 @@ static void find_mixer(struct userdata *u, pa_alsa_mapping *mapping, const char
u->mixers = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func,
NULL, (pa_free_cb_t) pa_alsa_mixer_free);
if (mapping)
mdev = pa_proplist_gets(mapping->proplist, "alsa.mixer_device");
mdev = mapping ? pa_proplist_gets(mapping->proplist, "alsa.mixer_device") : NULL;
if (mdev) {
u->mixer_handle = pa_alsa_open_mixer_by_name(u->mixers, mdev, true);
} else {

View file

@ -1821,8 +1821,7 @@ static void find_mixer(struct userdata *u, pa_alsa_mapping *mapping, const char
u->mixers = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func,
NULL, (pa_free_cb_t) pa_alsa_mixer_free);
if (mapping)
mdev = pa_proplist_gets(mapping->proplist, "alsa.mixer_device");
mdev = mapping ? pa_proplist_gets(mapping->proplist, "alsa.mixer_device") : NULL;
if (mdev) {
u->mixer_handle = pa_alsa_open_mixer_by_name(u->mixers, mdev, false);
} else {