diff options
Diffstat (limited to 'modules/desktop_capture/win/screen_capturer_win_gdi.cc')
-rw-r--r-- | modules/desktop_capture/win/screen_capturer_win_gdi.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/desktop_capture/win/screen_capturer_win_gdi.cc b/modules/desktop_capture/win/screen_capturer_win_gdi.cc index 9cb3681f..dc10eceb 100644 --- a/modules/desktop_capture/win/screen_capturer_win_gdi.cc +++ b/modules/desktop_capture/win/screen_capturer_win_gdi.cc @@ -133,7 +133,8 @@ void ScreenCapturerWinGdi::Capture(const DesktopRegion& region) { callback_->OnCaptureCompleted(frame); // Check for cursor shape update. - CaptureCursor(); + if (mouse_shape_observer_) + CaptureCursor(); } void ScreenCapturerWinGdi::SetMouseShapeObserver( @@ -279,6 +280,8 @@ bool ScreenCapturerWinGdi::CaptureImage() { } void ScreenCapturerWinGdi::CaptureCursor() { + assert(mouse_shape_observer_); + CURSORINFO cursor_info; cursor_info.cbSize = sizeof(CURSORINFO); if (!GetCursorInfo(&cursor_info)) { @@ -317,8 +320,7 @@ void ScreenCapturerWinGdi::CaptureCursor() { // Record the last cursor image that we sent to the client. last_cursor_ = *cursor; - if (mouse_shape_observer_) - mouse_shape_observer_->OnCursorShapeChanged(cursor.release()); + mouse_shape_observer_->OnCursorShapeChanged(cursor.release()); } } // namespace webrtc |