sdlaudio: fix samples vs. frames mix-up
authorVolker Rümelin <vr_qemu@t-online.de>
Tue, 1 Mar 2022 19:13:11 +0000 (20:13 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 4 Mar 2022 10:05:13 +0000 (11:05 +0100)
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>
audio/sdlaudio.c

index e605c787baf3c22d9ad0dee17b6396767de022d0..797b47bbddb14c991881d30b9de873a9500c90f5 100644 (file)
@@ -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;