GBA Audio: Redo lavr audio loop
Jeffrey Pfau jeffrey@endrift.com
Tue, 23 Dec 2014 21:57:42 -0800
1 files changed,
4 insertions(+),
4 deletions(-)
M
src/platform/ffmpeg/ffmpeg-resample.c
→
src/platform/ffmpeg/ffmpeg-resample.c
@@ -50,15 +50,15 @@ output += totalRead;
} 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; }