From a459c1f226c770e1b48995f2190cc6ae653be4d9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 13 Jul 2020 14:39:27 +0200 Subject: [PATCH] acp: sync with master --- spa/plugins/alsa/acp/alsa-ucm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spa/plugins/alsa/acp/alsa-ucm.c b/spa/plugins/alsa/acp/alsa-ucm.c index e1276571b..74247c423 100644 --- a/spa/plugins/alsa/acp/alsa-ucm.c +++ b/spa/plugins/alsa/acp/alsa-ucm.c @@ -920,14 +920,15 @@ static void probe_volumes(pa_hashmap *hash, bool is_sink, snd_pcm_t *pcm_handle, mdev = NULL; PA_DYNARRAY_FOREACH(dev, data->devices, idx) { mdev2 = get_mixer_device(dev, is_sink); - if (mdev && !pa_streq(mdev, mdev2)) { + if (mdev && mdev2 && !pa_streq(mdev, mdev2)) { pa_log_error("Two mixer device names found ('%s', '%s'), using s/w volume", mdev, mdev2); goto fail; } - mdev = mdev2; + if (mdev2) + mdev = mdev2; } - if (!(mixer_handle = pa_alsa_open_mixer_by_name(mixers, mdev, true))) { + if (mdev == NULL || !(mixer_handle = pa_alsa_open_mixer_by_name(mixers, mdev, true))) { pa_log_error("Failed to find a working mixer device (%s).", mdev); goto fail; }