[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/23] sdlaudio: fill remaining sample buffer with silence
From: |
Volker Rümelin |
Subject: |
[PATCH 06/23] sdlaudio: fill remaining sample buffer with silence |
Date: |
Sun, 10 Jan 2021 11:02:22 +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 <vr_qemu@t-online.de>
---
audio/sdlaudio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index 79eed23849..01ae4c600e 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);
}
}
--
2.26.2
- [PATCH 00/23] next round of audio patches, Volker Rümelin, 2021/01/10
- [PATCH 02/23] audio: fix bit-rotted code, Volker Rümelin, 2021/01/10
- [PATCH 01/23] sdlaudio: remove leftover SDL1.2 code, Volker Rümelin, 2021/01/10
- [PATCH 04/23] sdlaudio: don't start playback in init routine, Volker Rümelin, 2021/01/10
- [PATCH 05/23] sdlaudio: always clear the sample buffer, Volker Rümelin, 2021/01/10
- [PATCH 06/23] sdlaudio: fill remaining sample buffer with silence,
Volker Rümelin <=
- [PATCH 07/23] sdlaudio: replace legacy functions with modern ones, Volker Rümelin, 2021/01/10
- [PATCH 03/23] sdlaudio: add -audiodev sdl,out.buffer-count option, Volker Rümelin, 2021/01/10
- [PATCH 10/23] audio: break generic buffer dependency on mixing-engine, Volker Rümelin, 2021/01/10
- [PATCH 08/23] audio: split pcm_ops function get_buffer_in, Volker Rümelin, 2021/01/10