From af143bdd82068c9fca1c2965cee9c3be8682eb80 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 26 Jul 2018 03:09:59 +1000 Subject: [PATCH] [dxgi] update DXGI to use timeout return value --- host/Capture/DXGI.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/host/Capture/DXGI.cpp b/host/Capture/DXGI.cpp index 5e67aea8..55e94861 100644 --- a/host/Capture/DXGI.cpp +++ b/host/Capture/DXGI.cpp @@ -759,25 +759,9 @@ GrabStatus Capture::DXGI::GrabFrameRaw(FrameInfo & frame, struct CursorInfo & cu ID3D11Texture2DPtr src; bool timeout; - while(true) - { - result = GrabFrameTexture(frame, cursor, src, timeout); - if (timeout) - { - if (!m_surfaceMapped) - continue; - - // send the last frame again if we timeout to prevent the client stalling on restart - frame.pitch = m_mapping.RowPitch; - frame.stride = m_mapping.RowPitch >> 2; - - unsigned int size = m_height * m_mapping.RowPitch; - memcpySSE(frame.buffer, m_mapping.pData, LG_MIN(size, frame.bufferSize)); - return GRAB_STATUS_OK; - } - - break; - } + result = GrabFrameTexture(frame, cursor, src, timeout); + if (timeout) + return GRAB_STATUS_TIMEOUT; if (result != GRAB_STATUS_OK) return result;