[dxgi] update DXGI to use timeout return value

This commit is contained in:
Geoffrey McRae 2018-07-26 03:09:59 +10:00
parent 343983d9af
commit af143bdd82

View File

@ -759,25 +759,9 @@ GrabStatus Capture::DXGI::GrabFrameRaw(FrameInfo & frame, struct CursorInfo & cu
ID3D11Texture2DPtr src; ID3D11Texture2DPtr src;
bool timeout; bool timeout;
while(true)
{
result = GrabFrameTexture(frame, cursor, src, timeout); result = GrabFrameTexture(frame, cursor, src, timeout);
if (timeout) if (timeout)
{ return GRAB_STATUS_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;
}
if (result != GRAB_STATUS_OK) if (result != GRAB_STATUS_OK)
return result; return result;