summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorVolker RĂ¼melin2022-03-01 20:13:11 +0100
committerGerd Hoffmann2022-03-04 11:05:13 +0100
commit7b672528070ffe9c401d760c0edb75849d8e484e (patch)
tree72f9bdec995dda46dc0192d48f0852167b75a916 /audio
parentpaaudio: fix samples vs. frames mix-up (diff)
downloadqemu-7b672528070ffe9c401d760c0edb75849d8e484e.tar.gz
qemu-7b672528070ffe9c401d760c0edb75849d8e484e.tar.xz
qemu-7b672528070ffe9c401d760c0edb75849d8e484e.zip
sdlaudio: fix samples vs. frames mix-up
Fix the same samples vs. frames mix-up that the previous commit fixed for the PulseAudio backend. Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-15-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/sdlaudio.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index e605c787ba..797b47bbdd 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -347,11 +347,8 @@ static int sdl_init_out(HWVoiceOut *hw, struct audsettings *as,
req.freq = as->freq;
req.format = aud_to_sdlfmt (as->fmt);
req.channels = as->nchannels;
- /*
- * This is wrong. SDL samples are QEMU frames. The buffer size will be
- * the requested buffer size multiplied by the number of channels.
- */
- req.samples = audio_buffer_samples(
+ /* SDL samples are QEMU frames */
+ req.samples = audio_buffer_frames(
qapi_AudiodevSdlPerDirectionOptions_base(spdo), as, 11610);
req.callback = sdl_callback_out;
req.userdata = sdl;