libobs-d3d11: Correctly handle duplicator failure #12923
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This change corrects error handling in the D3D11 desktop duplicator update path.
Previously, certain DXGI failures during
AcquireNextFramewere not treated as fatal, causing the duplicator to remain in an invalid state and repeatedly return black frames.The function now correctly returns
falsewhen frame acquisition fails, allowing higher-level logic to recreate the duplicator when required.After applying this change and running it continuously for over four months across multiple systems, the persistent black screen issue has not reoccurred.
The error:
gs_duplicator_update_frame: Failed to update frame (887A0001)Occurred 3 times since applyting my patch and the duplicator has correctly recovered every time aka no permament black screen.
Motivation and Context
There have been long-standing reports of intermittent black screens when using DXGI desktop duplication capture in fullscreen games. Typically described as occurring very rarely and without a reliable reproduction path.
In practice, this issue manifests less than once per month and is therefore difficult to diagnose or reproduce on demand. When it does occur, capture remains black indefinitely until OBS or the capture pipeline is restarted (For example when clicking on the display capture source).
My testing shows that certain failure cases returned from AcquireNextFrame were not being handled as fatal errors when they should be. This leaves the duplicator in an invalid state instead of signaling failure and allowing higher-level logic to recreate the duplicator.
How Has This Been Tested?
Types of changes