]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commitdiff
hda-audio: fix non-mixer codecs
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 17 Apr 2014 10:43:26 +0000 (12:43 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 29 Apr 2014 08:46:29 +0000 (10:46 +0200)
They don't advertise mixer support, but still allow the guest change
mixer settings.  Add a check to avoid it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/audio/hda-codec.c

index a67ca91ca76073146e67ca27147cba63cbcfbb11..48c6eadb03a9190789dca3f14e96ef7e15bd4508 100644 (file)
@@ -261,6 +261,9 @@ static void hda_audio_set_amp(HDAAudioStream *st)
     left = left * 255 / QEMU_HDA_AMP_STEPS;
     right = right * 255 / QEMU_HDA_AMP_STEPS;
 
+    if (!st->state->mixer) {
+        return;
+    }
     if (st->output) {
         AUD_set_volume_out(st->voice.out, muted, left, right);
     } else {