Fix incorrectly placed if statement.

This commit is contained in:
Zachary Hall 2024-04-10 18:32:41 -07:00
parent 21ad4f5759
commit c1ee8bbaf2

View file

@ -94,14 +94,14 @@ void PlaybackInstance::SDLCallbackInner(Uint8 *stream, int len) {
size_t new_samples = render_vgmstream((sample_t*)(buf), (int)samples, this->stream); size_t new_samples = render_vgmstream((sample_t*)(buf), (int)samples, this->stream);
#else #else
size_t new_samples = render_vgmstream((sample_t*)(buf), (int)samples, this->stream); size_t new_samples = render_vgmstream((sample_t*)(buf), (int)samples, this->stream);
if (samples > new_samples) {
reset_vgmstream(this->stream);
}
samples = new_samples; samples = new_samples;
vgmstream_spec.samples = samples; vgmstream_spec.samples = samples;
SDL_AudioStreamPut(sdl_stream, buf, samples * sizeof(sample_t) * this->stream->channels); SDL_AudioStreamPut(sdl_stream, buf, samples * sizeof(sample_t) * this->stream->channels);
new_bufsize = SDL_AudioStreamGet(sdl_stream, buf, bufsize); new_bufsize = SDL_AudioStreamGet(sdl_stream, buf, bufsize);
#endif #endif
if (samples > new_samples) {
reset_vgmstream(this->stream);
}
for (int i = 0; i < new_bufsize / sizeof(SAMPLETYPE); i++) { for (int i = 0; i < new_bufsize / sizeof(SAMPLETYPE); i++) {
((SAMPLETYPE*)new_buf)[i] *= real_volume; ((SAMPLETYPE*)new_buf)[i] *= real_volume;
} }