Index: media/capture/video/win/video_capture_device_mf_win.cc |
diff --git a/media/capture/video/win/video_capture_device_mf_win.cc b/media/capture/video/win/video_capture_device_mf_win.cc |
index 88fd33d2c83c82bd56e92c738a7d802fb6cde53f..55df893518f81124f87977b1fc0f1ea03f1e977c 100644 |
--- a/media/capture/video/win/video_capture_device_mf_win.cc |
+++ b/media/capture/video/win/video_capture_device_mf_win.cc |
@@ -239,6 +239,7 @@ void VideoCaptureDeviceMFWin::AllocateAndStart( |
reader_->ReadSample(kFirstVideoStream, 0, NULL, NULL, NULL, NULL); |
if (SUCCEEDED(hr)) { |
capture_format_ = found_capability.supported_format; |
+ client_->OnStarted(); |
capture_ = true; |
return; |
} |
@@ -286,22 +287,23 @@ void VideoCaptureDeviceMFWin::OnIncomingCapturedData( |
base::TimeTicks reference_time, |
base::TimeDelta timestamp) { |
base::AutoLock lock(lock_); |
+ if (!capture_) |
+ return; |
+ |
if (data && client_.get()) { |
client_->OnIncomingCapturedData(data, length, capture_format_, rotation, |
reference_time, timestamp); |
} |
- if (capture_) { |
- HRESULT hr = |
- reader_->ReadSample(kFirstVideoStream, 0, NULL, NULL, NULL, NULL); |
- if (FAILED(hr)) { |
- // If running the *VideoCap* unit tests on repeat, this can sometimes |
- // fail with HRESULT_FROM_WINHRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION). |
- // It's not clear to me why this is, but it is possible that it has |
- // something to do with this bug: |
- // http://support.microsoft.com/kb/979567 |
- OnError(FROM_HERE, hr); |
- } |
+ HRESULT hr = |
+ reader_->ReadSample(kFirstVideoStream, 0, NULL, NULL, NULL, NULL); |
+ if (FAILED(hr)) { |
+ // If running the *VideoCap* unit tests on repeat, this can sometimes |
+ // fail with HRESULT_FROM_WINHRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION). |
+ // It's not clear to me why this is, but it is possible that it has |
+ // something to do with this bug: |
+ // http://support.microsoft.com/kb/979567 |
+ OnError(FROM_HERE, hr); |
} |
} |