Fixes bug where Peeking + Popping into a game resulted in slightly delayed audio

This commit is contained in:
Riley Testut 2016-05-19 03:23:55 -05:00
parent 290f1b93e5
commit 572ef0abec

View File

@ -106,6 +106,11 @@ class EmulationViewController: UIViewController
self.deferredPreparationHandler?()
self.deferredPreparationHandler = nil
// Toggle audioManager.enabled to reset the audio buffer and ensure the audio isn't delayed from the beginning
// This is especially noticeable when peeking a game
self.emulatorCore.audioManager.enabled = false
self.emulatorCore.audioManager.enabled = true
switch self.emulatorCore.state
{
case .Stopped: self.emulatorCore.startEmulation()