From: Volker RĂ¼melin <[email protected]>

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: [email protected]
Message-Id: <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
---
 audio/sdlaudio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index 79eed23849ea..01ae4c600e80 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.29.2


Reply via email to