Skip to content

Commit

Permalink
portals: application of the retries count in hlOnBufferDone (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
aacebedo authored Sep 1, 2024
1 parent d4c2b98 commit 11e15b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/portals/Screencopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,17 @@ 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);
}
return;
}

hyprland_toplevel_export_frame_v1_copy(frame, PSTREAM->currentPWBuffer->wlBuffer, false);

PSESSION->sharingData.copyRetries = 0;

Debug::log(TRACE, "[sc] wlr frame copied");
}

Expand Down

0 comments on commit 11e15b4

Please sign in to comment.