PSP2: Audio fixes
Vicki Pfau vi@endrift.com
Fri, 14 Sep 2018 20:22:23 -0700
2 files changed,
5 insertions(+),
2 deletions(-)
M
CHANGES
→
CHANGES
@@ -50,6 +50,7 @@ - GB: Fix IRQ disabling on the same T-cycle as an assert
- Core: Fix ordering events when scheduling during events - GBA: Reset WAITCNT properly - GBA Serialize: Fix loading states in Hblank + - PSP2: Fix more issues causing poor audio Misc: - GBA Timer: Use global cycles for timers - GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
M
src/platform/psp2/psp2-context.c
→
src/platform/psp2/psp2-context.c
@@ -234,8 +234,7 @@
static void _postAudioBuffer(struct mAVStream* stream, blip_t* left, blip_t* right) { UNUSED(stream); MutexLock(&audioContext.mutex); - struct GBAStereoSample* samples = &audioContext.buffer[audioContext.writeOffset]; - while (audioContext.samples == PSP2_AUDIO_BUFFER_SIZE) { + while (audioContext.samples + PSP2_SAMPLES >= PSP2_AUDIO_BUFFER_SIZE) { if (!frameLimiter) { blip_clear(left); blip_clear(right);@@ -244,6 +243,7 @@ return;
} ConditionWait(&audioContext.cond, &audioContext.mutex); } + struct GBAStereoSample* samples = &audioContext.buffer[audioContext.writeOffset]; blip_read_samples(left, &samples[0].left, PSP2_SAMPLES, true); blip_read_samples(right, &samples[0].right, PSP2_SAMPLES, true); audioContext.samples += PSP2_SAMPLES;@@ -403,6 +403,8 @@ #endif
default: break; } + audioContext.running = false; + ThreadJoin(audioThread); } void mPSP2Paused(struct mGUIRunner* runner) {