Bug 1298594: P4. Pop the frame when current time is past the end of the current frame. r=jwwang
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 29 Aug 2016 15:46:56 +1000
changeset 407043 2cdde44ebcc788af1a875217dc3022b1812d6538
parent 407042 ded582db991fcbedb51f42980f9bc1aca93d8a5f
child 407044 b1da49e041bbbb508ccfeac3b0a1eb4bf91b55af
push id27893
push userbmo:gasolin@mozilla.com
push dateTue, 30 Aug 2016 03:41:38 +0000
reviewersjwwang
bugs1298594
milestone51.0a1
Bug 1298594: P4. Pop the frame when current time is past the end of the current frame. r=jwwang 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
@@ -394,17 +394,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() > mMinVideoQueueSize &&
-         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);