Fix error handling in X11 screen capturer

Previusly errors from XServerPixelBuffer::CaptureRect() were not always
handled, which results in a black frame returned from the capturer
instead of an error.

BUG=webrtc:7305

Review-Url: https://codereview.webrtc.org/2738513005
Cr-Commit-Position: refs/heads/master@{#17101}
This commit is contained in:
sergeyu 2017-03-07 17:02:20 -08:00 committed by Commit bot
parent b09b3f9a62
commit 9fa7e4a0ac

View File

@ -340,7 +340,8 @@ std::unique_ptr<DesktopFrame> ScreenCapturerLinux::CaptureScreen() {
// Doing full-screen polling, or this is the first capture after a
// screen-resolution change. In either case, need a full-screen capture.
DesktopRect screen_rect = DesktopRect::MakeSize(frame->size());
x_server_pixel_buffer_.CaptureRect(screen_rect, frame.get());
if (!x_server_pixel_buffer_.CaptureRect(screen_rect, frame.get()))
return nullptr;
updated_region->SetRect(screen_rect);
}