Merge pull request #8 from DarthAffe/StuckCaptureFix

Added error-checking to the result of AcquireNextFrame in DX11 capture
This commit is contained in:
DarthAffe 2023-03-25 02:32:25 +01:00 committed by GitHub
commit 6283b38d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,7 +111,7 @@ public sealed class DX11ScreenCapture : IScreenCapture
IDXGIResource? screenResource = null;
try
{
_duplicatedOutput.AcquireNextFrame(Timeout, out OutduplFrameInfo duplicateFrameInformation, out screenResource);
_duplicatedOutput.AcquireNextFrame(Timeout, out OutduplFrameInfo duplicateFrameInformation, out screenResource).CheckError();
if ((screenResource == null) || (duplicateFrameInformation.LastPresentTime == 0)) return false;
using ID3D11Texture2D screenTexture = screenResource.QueryInterface<ID3D11Texture2D>();