From c1ee8bbaf278d18198f0d0abaf690b2b5708e75d Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Wed, 10 Apr 2024 18:32:41 -0700 Subject: [PATCH] Fix incorrectly placed if statement. --- playback.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playback.cpp b/playback.cpp index ec2d0e5..3a0821e 100644 --- a/playback.cpp +++ b/playback.cpp @@ -94,14 +94,14 @@ void PlaybackInstance::SDLCallbackInner(Uint8 *stream, int len) { size_t new_samples = render_vgmstream((sample_t*)(buf), (int)samples, this->stream); #else size_t new_samples = render_vgmstream((sample_t*)(buf), (int)samples, this->stream); - if (samples > new_samples) { - reset_vgmstream(this->stream); - } samples = new_samples; vgmstream_spec.samples = samples; SDL_AudioStreamPut(sdl_stream, buf, samples * sizeof(sample_t) * this->stream->channels); new_bufsize = SDL_AudioStreamGet(sdl_stream, buf, bufsize); #endif + if (samples > new_samples) { + reset_vgmstream(this->stream); + } for (int i = 0; i < new_bufsize / sizeof(SAMPLETYPE); i++) { ((SAMPLETYPE*)new_buf)[i] *= real_volume; }