From 9db0efadba16e1d884164d348f556922cfc80c50 Mon Sep 17 00:00:00 2001 From: Lynn Jarvis Date: Fri, 29 Jul 2022 18:09:49 +0930 Subject: [PATCH] Update SpoutFrameCount.cpp --- SPOUTSDK/SpoutGL/SpoutFrameCount.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/SPOUTSDK/SpoutGL/SpoutFrameCount.cpp b/SPOUTSDK/SpoutGL/SpoutFrameCount.cpp index dbcb08e5..ea5c9e59 100644 --- a/SPOUTSDK/SpoutGL/SpoutFrameCount.cpp +++ b/SPOUTSDK/SpoutGL/SpoutFrameCount.cpp @@ -52,6 +52,8 @@ // 21.02.22 - Change "_uuidof" to "__uuidof" in CheckKeyedAccess. PR#81 // 15.05.22 - CheckKeyedAccess - change WAIT_OBJECT_0 to S_OK // 27.07.22 - Change "_uuidof" to "__uuidof" in AllowKeyedAccess. PR#84 +// 29.07.22 - Correct "case case" typo in CheckKeyedAccess +// Add case E_FAIL // // ==================================================================================== // @@ -824,17 +826,24 @@ bool spoutFrameCount::CheckKeyedAccess(ID3D11Texture2D* pTexture) pTexture->QueryInterface(__uuidof(IDXGIKeyedMutex), (void**)&pDXGIKeyedMutex); // PR#81 if (pDXGIKeyedMutex) { HRESULT hr = pDXGIKeyedMutex->AcquireSync(0, 67); // TODO - link with SPOUT_WAIT_TIMEOUT + // Return S_OK if successful. switch (hr) { - case case S_OK: + case S_OK: // Sync is acquired pDXGIKeyedMutex->Release(); return true; case WAIT_ABANDONED: SpoutLogError("spoutDirectX::CheckKeyedAccess : WAIT_ABANDONED"); break; - case WAIT_TIMEOUT: // The time-out interval elapsed, and the object's state is non-signalled. + case WAIT_TIMEOUT: + // The time-out interval elapsed SpoutLogError("spoutDirectX::CheckKeyedAccess : WAIT_TIMEOUT"); break; + case E_FAIL: + // If the owning device attempted to create another keyed mutex + // on the same shared resource, AcquireSync returns E_FAIL. + SpoutLogError("spoutDirectX::CheckKeyedAccess : E_FAIL"); + break; default: break; }