diff mbox series

[07/12] spiceaudio: update comment

Message ID 20220923183640.8314-7-vr_qemu@t-online.de
State New
Headers show
Series audio: misc. improvements and bug fixes | expand

Commit Message

Volker Rümelin Sept. 23, 2022, 6:36 p.m. UTC
Replace a comment with a question with the answer.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
---
 audio/spiceaudio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Marc-André Lureau Sept. 27, 2022, 11:54 a.m. UTC | #1
On Fri, Sep 23, 2022 at 10:55 PM Volker Rümelin <vr_qemu@t-online.de> wrote:

> 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>



> ---
>  audio/spiceaudio.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c
> index 22892a7b9d..f52f3a8bbb 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;
> --
> 2.35.3
>
>
>
diff mbox series

Patch

diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c
index 22892a7b9d..f52f3a8bbb 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;