aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorVolker Rümelin <vr_qemu@t-online.de>2022-09-23 20:36:35 +0200
committerGerd Hoffmann <kraxel@redhat.com>2022-10-11 10:17:08 +0200
commit70ded68b45b90cf43a9a757df6483503055485f2 (patch)
treebf907f879da246f8ee9963eaa2b641cc488b6408 /audio
parent90320051ea998b6ac336cd635f8014ccb31154bd (diff)
downloadqemu-70ded68b45b90cf43a9a757df6483503055485f2.zip
qemu-70ded68b45b90cf43a9a757df6483503055485f2.tar.gz
qemu-70ded68b45b90cf43a9a757df6483503055485f2.tar.bz2
spiceaudio: update comment
Replace a comment with a question with the answer. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220923183640.8314-7-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/spiceaudio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c
index 22892a7..f52f3a8 100644
--- a/audio/spiceaudio.c
+++ b/audio/spiceaudio.c
@@ -242,7 +242,10 @@ static size_t line_in_read(HWVoiceIn *hw, void *buf, size_t len)
uint64_t to_read = audio_rate_get_bytes(&hw->info, &in->rate, len) >> 2;
size_t ready = spice_server_record_get_samples(&in->sin, buf, to_read);
- /* XXX: do we need this? */
+ /*
+ * If the client didn't send new frames, it most likely disconnected.
+ * Generate silence in this case to avoid a stalled audio stream.
+ */
if (ready == 0) {
memset(buf, 0, to_read << 2);
ready = to_read;