all repos — mgba @ bfcfd95413dba7889f0062c82a15850ebe7773b1

mGBA Game Boy Advance Emulator

DS Audio: Fix audio sync
Vicki Pfau vi@endrift.com
Sat, 28 Sep 2019 16:12:41 -0700
commit

bfcfd95413dba7889f0062c82a15850ebe7773b1

parent

dbdbcd13859e5c169a4eb7dbc6656fcd6819c222

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M src/ds/audio.csrc/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);