]> Git Repo - qemu.git/commitdiff
sdlaudio: fill remaining sample buffer with silence
authorVolker Rümelin <[email protected]>
Sun, 10 Jan 2021 10:02:22 +0000 (11:02 +0100)
committerGerd Hoffmann <[email protected]>
Fri, 15 Jan 2021 10:25:22 +0000 (11:25 +0100)
Fill the remaining sample buffer with silence. To fill it with
zeroes is wrong for unsigned samples because this is silence
with a DC bias.

Signed-off-by: Volker Rümelin <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
audio/sdlaudio.c

index 79eed23849ea03012743df8b1741f22b167c114b..01ae4c600e80824ecdf0226edeb8e9f3f3659a31 100644 (file)
@@ -235,7 +235,8 @@ static void sdl_callback (void *opaque, Uint8 *buf, int len)
 
     /* clear remaining buffer that we couldn't fill with data */
     if (len) {
-        memset(buf, 0, len);
+        audio_pcm_info_clear_buf(&hw->info, buf,
+                                 len / hw->info.bytes_per_frame);
     }
 }
 
This page took 0.026323 seconds and 4 git commands to generate.