Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Unified Diff: media/video/capture/file_video_capture_device.cc

Issue 1170573003: FileVideoCaptureDevice: If frames are lagging behind, don't try to catch up (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/file_video_capture_device.cc
diff --git a/media/video/capture/file_video_capture_device.cc b/media/video/capture/file_video_capture_device.cc
index 5a45b4a065cb7f82a79a7c1999d8465834bd8af7..295a35b30d7be116c0eeb7dd052ec198841a37f6 100644
--- a/media/video/capture/file_video_capture_device.cc
+++ b/media/video/capture/file_video_capture_device.cc
@@ -249,6 +249,10 @@ void FileVideoCaptureDevice::OnCaptureTask() {
next_frame_time_ = current_time + frame_interval;
} else {
next_frame_time_ += frame_interval;
+ // Don't accumulate any debt if we are lagging behind - just post next frame
+ // immediately and continue as normal.
+ if (next_frame_time_ < current_time)
+ next_frame_time_ = current_time;
}
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698