Skip to content

Commit

Permalink
Merge pull request #9 from FrostNovaHD/patch-9
Browse files Browse the repository at this point in the history
Patch 9
  • Loading branch information
WesleyVanNeck authored Mar 2, 2024
2 parents 483af95 + 81600fb commit 5ebef80
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ System Requirements

.. warning:: This table is a work in progress. Do not purchase hardware based on this.

**Minimum Requirements**
**Minimum Requirements**

+------------+------------------------------------------------------------+
| GPU | AMD: VCE 1.0 or higher, see `obs-amd hardware support`_ |
Expand Down
18 changes: 13 additions & 5 deletions src/platform/windows/display_wgc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ namespace platf::dxgi {
}
if (frame != nullptr) {
AcquireSRWLockExclusive(&frame_lock);
if (produced_frame) {
if (produced_frame)
produced_frame.Close();
}

produced_frame = frame;
WakeConditionVariable(&frame_present_cv);
ReleaseSRWLockExclusive(&frame_lock);
WakeConditionVariable(&frame_present_cv);
}
}

Expand All @@ -145,7 +145,11 @@ namespace platf::dxgi {
release_frame();

AcquireSRWLockExclusive(&frame_lock);
if (timeout.count() > 0 && SleepConditionVariableSRW(&frame_present_cv, &frame_lock, timeout.count(), 0) == FALSE) {

if (produced_frame == nullptr && SleepConditionVariableSRW(&frame_present_cv, &frame_lock, timeout.count(), 0) == 0) {



ReleaseSRWLockExclusive(&frame_lock);
if (GetLastError() == ERROR_TIMEOUT)
return capture_e::timeout;
Expand All @@ -157,7 +161,11 @@ namespace platf::dxgi {
produced_frame = nullptr;
}
ReleaseSRWLockExclusive(&frame_lock);
if (consumed_frame == nullptr && timeout.count() == 0)

if (consumed_frame == nullptr) // spurious wakeup



return capture_e::timeout;

auto capture_access = consumed_frame.Surface().as<winrt::IDirect3DDxgiInterfaceAccess>();
Expand Down

0 comments on commit 5ebef80

Please sign in to comment.