-
Nikos Chantziaras authored
In commit 6628042f, audio upload was moved from retro_run() to S9xDeinitUpdate(). This breaks audio when runahead is enabled in RetroArch. With second-instance runahead, S9xDeinitUpdate() is not called when video rendering is disabled and thus the core instance responsible for audio is not uploading the audio. With single-instance runahead, audio is uploaded twice because video rendering is always enabled and thus S9xDeinitUpdate() gets called twice per frame. Fix this by introducing a callback that gets called at the end of every screen refresh, regardless of whether or not rendering is active for this frame. We can then decide in the callback whether or not audio should be uploaded.