GBA Audio: Redo lavr audio loop

This commit is contained in:
Jeffrey Pfau 2014-12-23 21:57:42 -08:00
parent e89e7cc18a
commit 5b3a2e04b1
1 changed files with 4 additions and 4 deletions

View File

@ -50,15 +50,15 @@ unsigned GBAAudioResampleLAVR(struct GBAAudio* audio, struct AVAudioResampleCont
}
while (nSamples) {
unsigned read = GBAAudioCopy(audio, left, right, GBA_AUDIO_SAMPLES);
if (read == 0) {
memset(output, 0, nSamples * sizeof(struct GBAStereoSample));
break;
}
size_t currentRead = avresample_convert(avr, (uint8_t**) &output, nSamples * sizeof(struct GBAStereoSample), nSamples, (uint8_t**) samples, sizeof(left), read);
nSamples -= currentRead;
output += currentRead;
totalRead += currentRead;
if (read < GBA_AUDIO_SAMPLES && nSamples) {
memset(output, 0, nSamples * sizeof(struct GBAStereoSample));
break;
}
}
return totalRead;
}