Bug 1055967 - Log "discarding video frame" message only when we discard frames. r=cpearce
authorMatthew Gregan <kinetik@flim.org>
Wed, 20 Aug 2014 01:13:00 +1200
changeset 200748 2d0190cb96ad9c0951d89ba242f3f343294b523f
parent 200747 5cdc7c7332a978ff289dcfe6b5c05798f12fe60d
child 200749 16cad9b4140ce4bfd188fa0425b7db8968b61cbc
push id27353
push useremorley@mozilla.com
push dateThu, 21 Aug 2014 12:33:28 +0000
treeherdermozilla-central@479ec85d9e6f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1055967
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1055967 - Log "discarding video frame" message only when we discard frames. r=cpearce
content/media/MediaDecoderStateMachine.cpp
--- a/content/media/MediaDecoderStateMachine.cpp
+++ b/content/media/MediaDecoderStateMachine.cpp
@@ -2589,30 +2589,30 @@ void MediaDecoderStateMachine::AdvanceFr
   }
 
   int64_t clock_time = GetClock();
   // Skip frames up to the frame at the playback position, and figure out
   // the time remaining until it's time to display the next frame.
   int64_t remainingTime = AUDIO_DURATION_USECS;
   NS_ASSERTION(clock_time >= mStartTime, "Should have positive clock time.");
   nsAutoPtr<VideoData> currentFrame;
-#ifdef PR_LOGGING
-  int32_t droppedFrames = 0;
-#endif
   if (VideoQueue().GetSize() > 0) {
     VideoData* frame = VideoQueue().PeekFront();
+#ifdef PR_LOGGING
+    int32_t droppedFrames = 0;
+#endif
     while (mScheduler->IsRealTime() || clock_time >= frame->mTime) {
       mVideoFrameEndTime = frame->GetEndTime();
-      currentFrame = frame;
 #ifdef PR_LOGGING
-      VERBOSE_LOG("discarding video frame %lld", frame->mTime);
-      if (droppedFrames++) {
-        VERBOSE_LOG("discarding video frame %lld (%d so far)", frame->mTime, droppedFrames-1);
+      if (currentFrame) {
+        VERBOSE_LOG("discarding video frame mTime=%lld clock_time=%lld (%d so far)",
+                    currentFrame->mTime, ++droppedFrames);
       }
 #endif
+      currentFrame = frame;
       VideoQueue().PopFront();
       // Notify the decode thread that the video queue's buffers may have
       // free'd up space for more frames.
       mDecoder->GetReentrantMonitor().NotifyAll();
       OnPlaybackOffsetUpdate(frame->mOffset);
       if (VideoQueue().GetSize() == 0)
         break;
       frame = VideoQueue().PeekFront();