From 03f9955f8bf966aec25136f328ebf7b5ce0b537d Mon Sep 17 00:00:00 2001 From: Nikos Chantziaras Date: Wed, 23 Mar 2022 19:21:21 +0200 Subject: [PATCH] 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. --- shell/libretro/libretro.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/libretro/libretro.cpp b/shell/libretro/libretro.cpp index 9a4f29e7f..75f493658 100644 --- a/shell/libretro/libretro.cpp +++ b/shell/libretro/libretro.cpp @@ -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; }