From 8a957d02158e061dd07fa0a88f7748b413b76b31 Mon Sep 17 00:00:00 2001 From: Alexandre Acebedo Date: Sun, 1 Sep 2024 20:39:31 +0200 Subject: [PATCH] portals: application of the retries count in hlOnBufferDone --- src/portals/Screencopy.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/portals/Screencopy.cpp b/src/portals/Screencopy.cpp index 24d1443..e54b0be 100644 --- a/src/portals/Screencopy.cpp +++ b/src/portals/Screencopy.cpp @@ -271,6 +271,12 @@ static void hlOnBufferDone(void* data, hyprland_toplevel_export_frame_v1* frame) PSESSION->sharingData.windowFrameCallback = nullptr; Debug::log(LOG, "[screencopy/pipewire] Out of buffers"); PSESSION->sharingData.status = FRAME_NONE; + if (PSESSION->sharingData.copyRetries++ < MAX_RETRIES) { + Debug::log(LOG, "[sc] Retrying screencopy ({}/{})", PSESSION->sharingData.copyRetries, MAX_RETRIES); + g_pPortalManager->m_sPortals.screencopy->m_pPipewire->updateStreamParam(PSTREAM); + g_pPortalManager->m_sPortals.screencopy->queueNextShareFrame(PSESSION); + } + PSESSION->sharingData.copyRetries = 0; return; }