coreaudio: fix coreaudio playback

There are reports that since commit 2ceb8240fa "coreaudio: port
to the new audio backend api" audio playback with CoreAudio is
broken. This patch reverts some parts the commit.

Because of changes in the audio subsystem the audio clip
function in v4.1.0 of coreaudio.c had to be moved to mixeng.c
and the generic buffer management code needed a hint about the
size of the float type.

This patch is based on a patch from Zoltán Kővágó found at
https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg02142.html.

Fixes: 2ceb8240fa "coreaudio: port to the new audio backend api"

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20200202140641.4737-1-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Volker Rümelin 2020-02-02 15:06:41 +01:00 committed by Gerd Hoffmann
parent fb35c2cec5
commit 180b044ffd
4 changed files with 69 additions and 23 deletions

View file

@ -276,6 +276,13 @@ static HW *glue(audio_pcm_hw_add_new_, TYPE)(AudioState *s,
goto err1;
}
if (s->dev->driver == AUDIODEV_DRIVER_COREAUDIO) {
#ifdef DAC
hw->clip = clip_natural_float_from_stereo;
#else
hw->conv = conv_natural_float_to_stereo;
#endif
} else
#ifdef DAC
hw->clip = mixeng_clip
#else