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

Unified Diff: media/renderers/video_renderer_impl.cc

Issue 2034903002: Consider start time for frame painting and fix naming in test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update expectations for test. Created 4 years, 7 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 | media/renderers/video_renderer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/video_renderer_impl.cc
diff --git a/media/renderers/video_renderer_impl.cc b/media/renderers/video_renderer_impl.cc
index 9e4954e2783e1b282759171b9425fbbbfd32bf87..683005303287b0bddd3b98ac80f76eade77a13bf 100644
--- a/media/renderers/video_renderer_impl.cc
+++ b/media/renderers/video_renderer_impl.cc
@@ -398,7 +398,12 @@ void VideoRendererImpl::FrameReady(VideoFrameStream::Status status,
// We want to paint the first frame under two conditions: Either (1) we have
// enough frames to know it's definitely the first frame or (2) there may be
// no more frames coming (sometimes unless we paint one of them).
+ //
+ // For the first condition, we need at least two frames or the first frame
+ // must have a timestamp >= |start_timestamp_|, since otherwise we may be
+ // prerolling frames before the actual start time that will be dropped.
if (algorithm_->frames_queued() > 1 || received_end_of_stream_ ||
+ algorithm_->first_frame()->timestamp() >= start_timestamp_ ||
low_delay_ || !video_frame_stream_->CanReadWithoutStalling()) {
scoped_refptr<VideoFrame> frame = algorithm_->first_frame();
CheckForMetadataChanges(frame->format(), frame->natural_size());
« no previous file with comments | « no previous file | media/renderers/video_renderer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698