diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_linux.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_linux.cc index cdcd3b814e1c..0cab41c4f8df 100644 --- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_linux.cc +++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_linux.cc @@ -386,18 +386,6 @@ bool VideoCaptureModuleV4L2::CaptureProcess() { rSet.revents = 0; retVal = poll(&rSet, 1, 1000); - if (retVal < 0 && errno != EINTR) // continue if interrupted - { - // poll failed - return false; - } else if (retVal == 0) { - // poll timed out - return true; - } else if (!(rSet.revents & POLLIN)) { - // not event on camera handle - return true; - } - { MutexLock lock(&capture_lock_); @@ -405,6 +393,18 @@ bool VideoCaptureModuleV4L2::CaptureProcess() { return false; } + if (retVal < 0 && errno != EINTR) // continue if interrupted + { + // poll failed + return false; + } else if (retVal == 0) { + // poll timed out + return true; + } else if (!(rSet.revents & POLLIN)) { + // not event on camera handle + return true; + } + if (_captureStarted) { struct v4l2_buffer buf; memset(&buf, 0, sizeof(struct v4l2_buffer));