From 8a232d873b4c2119c642bcf488efc30b70f19b03 Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Sat, 15 Jul 2023 14:59:49 -0700 Subject: [PATCH] Hopefully fix crackling and fix a compiler warning --- playback.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playback.cpp b/playback.cpp index 3828cf1..8fe3a00 100644 --- a/playback.cpp +++ b/playback.cpp @@ -9,7 +9,7 @@ size_t CalculateBufSize(SDL_AudioSpec *obtained, double max_seconds, size_t samp return ((((samples_override == 0) ? obtained->samples : samples_override) * max_seconds) + 1) * sizeof(SAMPLETYPE) * obtained->channels; } void Playback::SDLCallbackInner(Uint8 *stream, int len) { - while (st->numSamples() < len) { + while (st->numSamples() <= (uint)len) { general_mixer(NULL, buf, bufsize); st->putSamples((SAMPLETYPE*)buf, bufsize / sizeof(SAMPLETYPE) / spec.channels); }