Hopefully fix crackling and fix a compiler warning

This commit is contained in:
Zachary Hall 2023-07-15 14:59:49 -07:00
parent 5e0d257b94
commit 8a232d873b

View file

@ -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; return ((((samples_override == 0) ? obtained->samples : samples_override) * max_seconds) + 1) * sizeof(SAMPLETYPE) * obtained->channels;
} }
void Playback::SDLCallbackInner(Uint8 *stream, int len) { void Playback::SDLCallbackInner(Uint8 *stream, int len) {
while (st->numSamples() < len) { while (st->numSamples() <= (uint)len) {
general_mixer(NULL, buf, bufsize); general_mixer(NULL, buf, bufsize);
st->putSamples((SAMPLETYPE*)buf, bufsize / sizeof(SAMPLETYPE) / spec.channels); st->putSamples((SAMPLETYPE*)buf, bufsize / sizeof(SAMPLETYPE) / spec.channels);
} }