]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
coreaudio: don't start playback in init routine
authorVolker Rümelin <vr_qemu@t-online.de>
Sun, 13 Dec 2020 13:05:26 +0000 (14:05 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 15 Dec 2020 08:14:17 +0000 (09:14 +0100)
Every emulated audio device has a way to enable audio playback. Don't
start playback until the guest enables the audio device to keep the
Core Audio device run state in sync with hw->enabled.

Tested-by: Howard Spoelstra <hsp.cat7@gmail.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20201213130528.5863-2-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
audio/coreaudio.c

index 0ee85052c4529dc598663ec37f1334b1a4d4466e..a5df950514617fd1355e915bf6eb5ff9f344c216 100644 (file)
@@ -584,17 +584,6 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as,
         return -1;
     }
 
-    /* start Playback */
-    if (!isPlaying(core->outputDeviceID)) {
-        status = AudioDeviceStart(core->outputDeviceID, core->ioprocid);
-        if (status != kAudioHardwareNoError) {
-            coreaudio_logerr2 (status, typ, "Could not start playback\n");
-            AudioDeviceDestroyIOProcID(core->outputDeviceID, core->ioprocid);
-            core->outputDeviceID = kAudioDeviceUnknown;
-            return -1;
-        }
-    }
-
     return 0;
 }