[GME Input] Fix decoder output sample count

The output has been assigning twice as many samples as it was supposed
to ever since commit 8d851e5bda, which
ended up generating the correct 1024 samples (2048 per GME parameter),
but assigned 2048 to the AudioChunk, which resulted in over-reading the
audio buffer, and thankfully not crashing, but instead causing an awful
sound distortion effect as random memory contents were played as PCM
audio.

Fixes #320

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
main
Christopher Snowhill 2022-08-04 18:01:09 -07:00
parent 4480eeefbe
commit 5ac279e289
1 changed files with 1 additions and 1 deletions

View File

@ -198,7 +198,7 @@ gme_err_t readCallback(void *data, void *out, int count) {
//(From gme.txt) If track length, then use it. If loop length, play for intro + loop * 2. Otherwise, default to 2.5 minutes //(From gme.txt) If track length, then use it. If loop length, play for intro + loop * 2. Otherwise, default to 2.5 minutes
// GME will always generate samples. There's no real EOS. // GME will always generate samples. There's no real EOS.
[chunk assignSamples:sampleBuffer frameCount:numSamples]; [chunk assignSamples:sampleBuffer frameCount:frames];
return chunk; return chunk;
} }