From 4165a5bfd1e52da1d4057dcb8d718a4fe8d40066 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 23 Aug 2006 15:25:43 +0200 Subject: [PATCH] Fix dB ops for global volume Fixed dB ops for global volume. --- src/mixer/simple_none.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c index 276d9c72..1debacd8 100644 --- a/src/mixer/simple_none.c +++ b/src/mixer/simple_none.c @@ -1103,7 +1103,12 @@ static int get_dB_ops(snd_mixer_elem_t *elem, c = &s->ctls[CTL_CAPTURE_VOLUME]; else goto _err; - if (c->type != 2) + if (! c->elem) { + c = &s->ctls[CTL_GLOBAL_VOLUME]; + if (! c->elem) + goto _err; + } + if (c->type != SND_CTL_ELEM_TYPE_INTEGER) goto _err; if ((err = get_volume_ops(elem, dir, channel, &volume)) < 0) goto _err; -- 2.47.1