aboutsummaryrefslogtreecommitdiff
path: root/audio/audio.c
diff options
context:
space:
mode:
authorVolker RĂ¼melin <vr_qemu@t-online.de>2020-09-20 19:17:23 +0200
committerGerd Hoffmann <kraxel@redhat.com>2020-09-23 08:19:42 +0200
commitaec6d0dc4ef243b957115b3c3aef39c348fefb25 (patch)
treea573fd566d75bdf455da826a6ec6b872899406cd /audio/audio.c
parent4c3356f96557e848f0323772f9502d60817682dc (diff)
downloadqemu-aec6d0dc4ef243b957115b3c3aef39c348fefb25.zip
qemu-aec6d0dc4ef243b957115b3c3aef39c348fefb25.tar.gz
qemu-aec6d0dc4ef243b957115b3c3aef39c348fefb25.tar.bz2
audio/spiceaudio: always rate limit playback stream
The playback rate with the spiceaudio backend is currently too fast if there's no spice client connected or the spice client can't play audio. Rate limit the audio playback stream in all cases. To calculate the rate correctly the limiter has to know the maximum buffer size. Fixes: 8c198ff065 ("spiceaudio: port to the new audio backend api") Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-3-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio/audio.c')
-rw-r--r--audio/audio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/audio.c b/audio/audio.c
index 7b660dd..d5891e1 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1089,7 +1089,8 @@ static size_t audio_pcm_hw_run_out(HWVoiceOut *hw, size_t live)
size_t clipped = 0;
while (live) {
- size_t size, decr, proc;
+ size_t size = live * hw->info.bytes_per_frame;
+ size_t decr, proc;
void *buf = hw->pcm_ops->get_buffer_out(hw, &size);
if (size == 0) {