Bug 1298594: P4. Pop the frame when current time is past the end of the current frame. r?jwwang draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 29 Aug 2016 15:46:56 +1000
changeset 406670 3dee30390dbcfdd05620e9053e1e23bbdf1bec60
parent 406669 714b98cbe16f29ad61ef5782138bb41d06885e81
child 406671 84d84728326debeb4f673950122e1818a5549e69
push id27789
push userbmo:jyavenard@mozilla.com
push dateMon, 29 Aug 2016 08:51:10 +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
@@ -392,17 +392,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);