Bug 1298594 - P4. Pop the frame when current time is past the end of the current frame. r=jwwang, a=ritu
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 29 Aug 2016 15:46:56 +1000
changeset 350150 f04b44d05fccb5264ae226fc536b084c7390c345
parent 350149 0ee7678d527b144dad11f42fe05ad76f9f880fdf
child 350151 440a4a4d490e0a39f846cc390c26a5689b899e8b
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang, ritu
bugs1298594
milestone50.0a2
Bug 1298594 - P4. Pop the frame when current time is past the end of the current frame. r=jwwang, a=ritu Most frames start when the previous one stop. MozReview-Commit-ID: H92Bmiki49Q
dom/media/mediasink/VideoSink.cpp
--- a/dom/media/mediasink/VideoSink.cpp
+++ b/dom/media/mediasink/VideoSink.cpp
@@ -390,17 +390,17 @@ VideoSink::UpdateRenderedVideoFrames()
   // Get the current playback position.
   TimeStamp nowTime;
   const int64_t clockTime = mAudioSink->GetPosition(&nowTime);
   NS_ASSERTION(clockTime >= 0, "Should have positive clock time.");
 
   // Skip frames up to the playback position.
   int64_t lastDisplayedFrameEndTime = 0;
   while (VideoQueue().GetSize() > 0 &&
-         clockTime > VideoQueue().PeekFront()->GetEndTime()) {
+         clockTime >= VideoQueue().PeekFront()->GetEndTime()) {
     RefPtr<MediaData> frame = VideoQueue().PopFront();
     if (frame->As<VideoData>()->mSentToCompositor) {
       lastDisplayedFrameEndTime = frame->GetEndTime();
       mFrameStats.NotifyPresentedFrame();
     } else {
       mFrameStats.NotifyDecodedFrames({ 0, 0, 1 });
       VSINK_LOG_V("discarding video frame mTime=%lld clock_time=%lld",
                   frame->mTime, clockTime);