From db584708962a4740639c15d9f4aaa8addbdbee83 Mon Sep 17 00:00:00 2001 From: lennoxlotl Date: Mon, 19 Aug 2024 15:13:00 +0200 Subject: [PATCH] portals: change max retries count --- src/portals/Screencopy.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/portals/Screencopy.cpp b/src/portals/Screencopy.cpp index 7664982..24d1443 100644 --- a/src/portals/Screencopy.cpp +++ b/src/portals/Screencopy.cpp @@ -8,6 +8,8 @@ #include #include +constexpr static int MAX_RETRIES = 10; + // --------------- Wayland Protocol Handlers --------------- // static void wlrOnBuffer(void* data, zwlr_screencopy_frame_v1* frame, uint32_t format, uint32_t width, uint32_t height, uint32_t stride) { @@ -128,8 +130,8 @@ static void wlrOnBufferDone(void* data, zwlr_screencopy_frame_v1* frame) { PSESSION->sharingData.frameCallback = nullptr; Debug::log(LOG, "[screencopy/pipewire] Out of buffers"); PSESSION->sharingData.status = FRAME_NONE; - if (PSESSION->sharingData.copyRetries++ < 6) { - Debug::log(LOG, "[sc] Retrying screencopy ({}/6)", PSESSION->sharingData.copyRetries); + 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); }