From 0da25942512e874e587cfbcb71b9f45f3f905fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20B?= Date: Sun, 26 Sep 2021 12:10:25 +0200 Subject: [PATCH] Make BUF_TO_READ larger to fix audio in some cases If the preview .ogg has a samplerate > the BUF_TO_READ constant, there was an out of bounds write to the audio buffers which resulted in crackling. Thus, upped it to 48000 (0x80-aligned, and pretty much the highest rate anything consumer goes). a bit big, but safe. --- include/music.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/music.h b/include/music.h index 6eae180..d962e59 100644 --- a/include/music.h +++ b/include/music.h @@ -34,7 +34,7 @@ #include #include -#define BUF_TO_READ 40960 // How much data should be buffered at a time +#define BUF_TO_READ 48000 // How much data should be buffered at a time typedef struct { OggVorbis_File vf; @@ -51,4 +51,4 @@ typedef struct { void play_audio(audio_s *); -#endif \ No newline at end of file +#endif