aboutsummaryrefslogtreecommitdiff
path: root/audio/sdlaudio.c
diff options
context:
space:
mode:
authorVolker RĂ¼melin <vr_qemu@t-online.de>2022-03-01 20:13:06 +0100
committerGerd Hoffmann <kraxel@redhat.com>2022-03-04 11:05:13 +0100
commit9833438ef624155de879d4ed57ecfcd3464a0bbe (patch)
tree2774d4652e970f5ff9fb2d5caa96204882d5765a /audio/sdlaudio.c
parent669b95229d13e3c521c2f50bcc9ca0503efb3c5f (diff)
downloadqemu-9833438ef624155de879d4ed57ecfcd3464a0bbe.zip
qemu-9833438ef624155de879d4ed57ecfcd3464a0bbe.tar.gz
qemu-9833438ef624155de879d4ed57ecfcd3464a0bbe.tar.bz2
audio: restore mixing-engine playback buffer size
Commit ff095e5231 "audio: api for mixeng code free backends" introduced another FIFO for the audio subsystem with exactly the same size as the mixing-engine FIFO. Most audio backends use this generic FIFO. The generic FIFO used together with the mixing-engine FIFO doubles the audio FIFO size, because that's just two independent FIFOs connected together in series. For audio playback this nearly doubles the playback latency. This patch restores the effective mixing-engine playback buffer size to a pre v4.2.0 size by only accepting the amount of samples for the mixing-engine queue which the downstream queue accepts. Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de> Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20220301191311.26695-10-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio/sdlaudio.c')
-rw-r--r--audio/sdlaudio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index d6f3aa1..e605c78 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -309,6 +309,7 @@ static void sdl_callback_in(void *opaque, Uint8 *buf, int len)
SDL_UnlockAudioDevice(sdl->devid); \
}
+SDL_WRAPPER_FUNC(buffer_get_free, size_t, (HWVoiceOut *hw), (hw), Out)
SDL_WRAPPER_FUNC(get_buffer_out, void *, (HWVoiceOut *hw, size_t *size),
(hw, size), Out)
SDL_WRAPPER_FUNC(put_buffer_out, size_t,
@@ -471,6 +472,8 @@ static struct audio_pcm_ops sdl_pcm_ops = {
.fini_out = sdl_fini_out,
/* wrapper for audio_generic_write */
.write = sdl_write,
+ /* wrapper for audio_generic_buffer_get_free */
+ .buffer_get_free = sdl_buffer_get_free,
/* wrapper for audio_generic_get_buffer_out */
.get_buffer_out = sdl_get_buffer_out,
/* wrapper for audio_generic_put_buffer_out */