From 7b672528070ffe9c401d760c0edb75849d8e484e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20R=C3=BCmelin?= Date: Tue, 1 Mar 2022 20:13:11 +0100 Subject: [PATCH] sdlaudio: fix samples vs. frames mix-up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the same samples vs. frames mix-up that the previous commit fixed for the PulseAudio backend. Signed-off-by: Volker RĂ¼melin Message-Id: <20220301191311.26695-15-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/sdlaudio.c | 7 ++----- 1 file 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;