This commit is contained in:
Nishi 2026-01-27 16:32:53 +09:00
commit 712c063c42
Signed by: nishi
GPG key ID: 27EF69B208EB9343
2 changed files with 4 additions and 1 deletions

View file

@ -103,6 +103,8 @@ void GSSoundClose(GSSound sound) {
if(sound->from_samplerate > 0) ma_resampler_uninit(&sound->resampler, NULL);
if(sound->from_channel != 2) ma_channel_converter_uninit(&sound->converter, NULL);
free(sound);
}

View file

@ -60,9 +60,10 @@ static void read_callback(void* opaque, GSI16* out, int frame) {
memset(result3, 0, sizeof(*result3) * frame * 2);
ma_channel_converter_process_pcm_frames(&sengine->sound[i]->converter, result3, result2, frame);
for(j = 0; j < s * 2; j++) buffer[j] += (GSNumber)result3[j] / 32767;
}
for(j = 0; j < s * 2; j++) buffer[j] += (GSNumber)result3[j] / 32767;
if(result3 != result2) free(result3);
if(result2 != result) free(result2);
} else if(sengine->sound[i]->loop && sengine->sound[i]->reset != NULL) {