OSDN Git Service

Fix dB ops for global volume
authorTakashi Iwai <tiwai@suse.de>
Wed, 23 Aug 2006 13:25:43 +0000 (15:25 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 23 Aug 2006 13:25:43 +0000 (15:25 +0200)
Fixed dB ops for global volume.

src/mixer/simple_none.c

index 276d9c7..1debacd 100644 (file)
@@ -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;