libretro: present frames before audio upload

retro_audio_sample_batch_t can block for a long time if the frontend
performs audio sync. This unnecessarily delays frame presentation.
This commit is contained in:
Nikos Chantziaras 2022-03-23 19:21:21 +02:00 committed by flyinghead
parent 514eedbc63
commit 03f9955f8b
1 changed files with 2 additions and 2 deletions

View File

@ -1018,13 +1018,13 @@ void retro_run()
if (isOpenGL(config::RendererType))
glsm_ctl(GLSM_CTL_STATE_UNBIND, nullptr);
video_cb(is_dupe ? 0 : RETRO_HW_FRAME_BUFFER_VALID, framebufferWidth, framebufferHeight, 0);
if (!config::ThreadedRendering || config::LimitFPS)
retro_audio_upload();
else
retro_audio_flush_buffer();
video_cb(is_dupe ? 0 : RETRO_HW_FRAME_BUFFER_VALID, framebufferWidth, framebufferHeight, 0);
first_run = false;
}