mirror of https://github.com/mgba-emu/mgba.git
GBA Audio: Redo lavr audio loop
This commit is contained in:
parent
e89e7cc18a
commit
5b3a2e04b1
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue