]> git.ipfire.org Git - thirdparty/qemu.git/commit
audio: fix size calculation in AUD_get_buffer_size_out()
authorVolker Rümelin <vr_qemu@t-online.de>
Thu, 15 May 2025 05:44:25 +0000 (07:44 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 5 Jun 2025 12:10:30 +0000 (15:10 +0300)
commita399d3c13031cf3779d844dbf8b7e6b3996b5709
treecab42c40e1f4a5ddca71d30355d51f37c2ddc041
parentf9a70c82c231f745726f40bd190763775d16b1e8
audio: fix size calculation in AUD_get_buffer_size_out()

The buffer size calculated by AUD_get_buffer_size_out() is often
incorrect. sw->hw->samples * sw->hw->info.bytes_per_frame is the
size of the mixing engine buffer in audio frames multiplied by
the size of one frame of the audio backend. Due to resampling or
format conversion, the size of the frontend buffer can differ
significantly.

Return the correct buffer size when the mixing engine is used.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20250515054429.7385-3-vr_qemu@t-online.de>
(cherry picked from commit ccb4fec0e5f233cb61a83b3af59ae11716ea06c0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
audio/audio.c