From 3d0a8f69870083f02b6183adc277d8786424d5e3 Mon Sep 17 00:00:00 2001 From: Chris Spencer Date: Wed, 12 Jan 2022 22:14:58 +0000 Subject: [PATCH] [host] dxgi: fix frame damage method parameters The buffer input sizes to the `IDXGIOutputDuplication` methods are measured in bytes. This dramatically increases the number of dirty/move rects that can be handled. --- host/platform/Windows/capture/DXGI/src/dxgi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/platform/Windows/capture/DXGI/src/dxgi.c b/host/platform/Windows/capture/DXGI/src/dxgi.c index 3b9fd771..c3511116 100644 --- a/host/platform/Windows/capture/DXGI/src/dxgi.c +++ b/host/platform/Windows/capture/DXGI/src/dxgi.c @@ -694,7 +694,7 @@ static void computeFrameDamage(Texture * tex) RECT dirtyRects[maxDamageRectsCount]; UINT dirtyRectsBufferSizeRequired; if (FAILED(IDXGIOutputDuplication_GetFrameDirtyRects(this->dup, - ARRAY_LENGTH(dirtyRects), dirtyRects, + sizeof(dirtyRects), dirtyRects, &dirtyRectsBufferSizeRequired))) return; @@ -709,7 +709,7 @@ static void computeFrameDamage(Texture * tex) DXGI_OUTDUPL_MOVE_RECT moveRects[(maxDamageRectsCount - dirtyRectsCount) / 2]; UINT moveRectsBufferSizeRequired; if (FAILED(IDXGIOutputDuplication_GetFrameMoveRects(this->dup, - ARRAY_LENGTH(moveRects), moveRects, + sizeof(moveRects), moveRects, &moveRectsBufferSizeRequired))) return;