Don't override permanent errors in WindowCapturerWinGdi.

This is a follow up to this CL
https://webrtc-review.googlesource.com/c/src/+/269223
which unintentionally prevents the WindowCapturerWinGdi from returning
permanent errors.

Bug: webrtc:14265
Change-Id: I8eb9f8852fb6247a045d32e407ebdd5f45e6aa9d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271880
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Commit-Queue: Mark Foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#37847}
This commit is contained in:
Austin Orion 2022-08-18 14:07:16 -07:00 committed by WebRTC LUCI CQ
parent f7f9791cc7
commit b1372f973a

View File

@ -161,7 +161,10 @@ void WindowCapturerWinGdi::CaptureFrame() {
CaptureResults results = CaptureFrame(/*capture_owned_windows*/ true);
if (!results.frame) {
callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
// Don't return success if we have no frame.
results.result = results.result == Result::SUCCESS ? Result::ERROR_TEMPORARY
: results.result;
callback_->OnCaptureResult(results.result, nullptr);
return;
}