mirror of https://github.com/mgba-emu/mgba.git
SDL: Fix audio sync
This commit is contained in:
parent
1c6b98a2b4
commit
2e0ee682a5
|
@ -110,7 +110,9 @@ static void _mSDLAudioCallback(void* context, Uint8* data, int len) {
|
||||||
double fauxClock = 1;
|
double fauxClock = 1;
|
||||||
if (audioContext->thread) {
|
if (audioContext->thread) {
|
||||||
fauxClock = GBAAudioCalculateRatio(1, audioContext->thread->fpsTarget, 1);
|
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(left, clockRate, audioContext->obtainedSpec.freq * fauxClock);
|
||||||
blip_set_rates(right, clockRate, audioContext->obtainedSpec.freq * fauxClock);
|
blip_set_rates(right, clockRate, audioContext->obtainedSpec.freq * fauxClock);
|
||||||
|
|
Loading…
Reference in New Issue