diff options
author | Volker RĂ¼melin <vr_qemu@t-online.de> | 2021-01-10 11:02:22 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2021-01-15 11:25:22 +0100 |
commit | e02d178f78d7cff93c3c9b7e3c3ac6822c46c563 (patch) | |
tree | 278da57a4354b34a6a4ef0cd267af1d48a9c5ede | |
parent | bcce2ea5f63bb5eedfa6c4872f3a4b8a84ff9f07 (diff) | |
download | qemu-e02d178f78d7cff93c3c9b7e3c3ac6822c46c563.zip qemu-e02d178f78d7cff93c3c9b7e3c3ac6822c46c563.tar.gz qemu-e02d178f78d7cff93c3c9b7e3c3ac6822c46c563.tar.bz2 |
sdlaudio: fill remaining sample buffer with silence
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 <vr_qemu@t-online.de>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-6-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | audio/sdlaudio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 79eed23..01ae4c6 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -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); } } |