all repos — mgba @ 2e0ee682a589c08d965a57b70c772141e8ca042f

mGBA Game Boy Advance Emulator

SDL: Fix audio sync
Jeffrey Pfau jeffrey@endrift.com
Sun, 07 Feb 2016 12:06:13 -0800
commit

2e0ee682a589c08d965a57b70c772141e8ca042f

parent

1c6b98a2b44f662137bb0e4f3726520dda674e5f

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

jump to
M src/platform/sdl/sdl-audio.csrc/platform/sdl/sdl-audio.c

@@ -110,7 +110,9 @@ }

double fauxClock = 1; if (audioContext->thread) { fauxClock = GBAAudioCalculateRatio(1, audioContext->thread->fpsTarget, 1); - mCoreSyncLockAudio(&audioContext->thread->sync); + } + if (audioContext->sync) { + mCoreSyncLockAudio(audioContext->sync); } blip_set_rates(left, clockRate, audioContext->obtainedSpec.freq * fauxClock); blip_set_rates(right, clockRate, audioContext->obtainedSpec.freq * fauxClock);