DS Audio: Fix audio sync
Vicki Pfau vi@endrift.com
Sat, 28 Sep 2019 16:12:41 -0700
1 files changed,
4 insertions(+),
1 deletions(-)
jump to
M
src/ds/audio.c
→
src/ds/audio.c
@@ -352,7 +352,10 @@ if (audio->p->stream && audio->p->stream->postAudioFrame) {
audio->p->stream->postAudioFrame(audio->p->stream, sampleLeft, sampleRight); } bool wait = produced >= audio->samples; - mCoreSyncProduceAudio(audio->p->sync, audio->left, wait); + if (!mCoreSyncProduceAudio(audio->p->sync, audio->left, audio->samples)) { + // Interrupted + audio->p->earlyExit = true; + } if (wait && audio->p->stream && audio->p->stream->postAudioBuffer) { audio->p->stream->postAudioBuffer(audio->p->stream, audio->left, audio->right);