Bug 1143575. Rename clock_time to clockTime. r=cpearce draft
authorRobert O'Callahan <robert@ocallahan.org>
Mon, 30 Mar 2015 16:00:57 +1300
changeset 275574 5b07b595a5ca7206f56dfae421c6b8a7230e899d
parent 275573 3f0de889771f9c18348861509da4faced112a52f
child 275575 f57771ffd0f6c01a6dda19be33d8366fffc167c8
push id3189
push userrocallahan@mozilla.com
push dateFri, 03 Jul 2015 11:12:01 +0000
reviewerscpearce
bugs1143575
milestone42.0a1
Bug 1143575. Rename clock_time to clockTime. r=cpearce
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2845,43 +2845,43 @@ void MediaDecoderStateMachine::UpdateRen
     return;
   }
 
   if (mAudioCaptured) {
     SendStreamData();
   }
 
   TimeStamp nowTime;
-  const int64_t clock_time = GetClock(&nowTime);
+  const int64_t clockTime = GetClock(&nowTime);
   // 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 >= 0, "Should have positive clock time.");
+  NS_ASSERTION(clockTime >= 0, "Should have positive clock time.");
   nsRefPtr<VideoData> currentFrame;
   if (VideoQueue().GetSize() > 0) {
     VideoData* frame = VideoQueue().PeekFront();
     int32_t droppedFrames = 0;
-    while (IsRealTime() || clock_time >= frame->mTime) {
+    while (IsRealTime() || clockTime >= frame->mTime) {
       mVideoFrameEndTime = frame->GetEndTime();
       if (currentFrame) {
         mDecoder->NotifyDecodedFrames(0, 0, 1);
         VERBOSE_LOG("discarding video frame mTime=%lld clock_time=%lld (%d so far)",
-                    currentFrame->mTime, clock_time, ++droppedFrames);
+                    currentFrame->mTime, clockTime, ++droppedFrames);
       }
       currentFrame = frame;
       nsRefPtr<VideoData> releaseMe = VideoQueue().PopFront();
       OnPlaybackOffsetUpdate(frame->mOffset);
       if (VideoQueue().GetSize() == 0)
         break;
       frame = VideoQueue().PeekFront();
     }
     // Current frame has already been presented, wait until it's time to
     // present the next frame.
     if (frame && !currentFrame) {
-      remainingTime = frame->mTime - clock_time;
+      remainingTime = frame->mTime - clockTime;
     }
   }
 
   // Check to see if we don't have enough data to play up to the next frame.
   // If we don't, switch to buffering mode.
   if (mState == DECODER_STATE_DECODING &&
       mPlayState == MediaDecoder::PLAY_STATE_PLAYING &&
       mDecoder->IsExpectingMoreData()) {
@@ -2907,57 +2907,57 @@ void MediaDecoderStateMachine::UpdateRen
     }
   }
 
   // Cap the current time to the larger of the audio and video end time.
   // This ensures that if we're running off the system clock, we don't
   // advance the clock to after the media end time.
   if (mVideoFrameEndTime != -1 || mAudioEndTime != -1) {
     // These will be non -1 if we've displayed a video frame, or played an audio frame.
-    int64_t t = std::min(clock_time, std::max(mVideoFrameEndTime, mAudioEndTime));
+    int64_t t = std::min(clockTime, std::max(mVideoFrameEndTime, mAudioEndTime));
     // FIXME: Bug 1091422 - chained ogg files hit this assertion.
     //MOZ_ASSERT(t >= GetMediaTime());
     if (t > GetMediaTime()) {
       UpdatePlaybackPosition(t);
     }
   }
   // Note we have to update playback position before releasing the monitor.
   // Otherwise, MediaDecoder::AddOutputStream could kick in when we are outside
   // the monitor and get a staled value from GetCurrentTimeUs() which hits the
   // assertion in GetClock().
 
   if (currentFrame) {
     // Decode one frame and display it.
-    int64_t delta = currentFrame->mTime - clock_time;
+    int64_t delta = currentFrame->mTime - clockTime;
     TimeStamp presTime = nowTime + TimeDuration::FromMicroseconds(delta / mPlaybackRate);
     NS_ASSERTION(currentFrame->mTime >= 0, "Should have positive frame time");
     {
       ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
       // If we have video, we want to increment the clock in steps of the frame
       // duration.
       RenderVideoFrame(currentFrame, presTime);
     }
     MOZ_ASSERT(IsPlaying());
     MediaDecoder::FrameStatistics& frameStats = mDecoder->GetFrameStatistics();
     frameStats.NotifyPresentedFrame();
-    remainingTime = currentFrame->GetEndTime() - clock_time;
+    remainingTime = currentFrame->GetEndTime() - clockTime;
     currentFrame = nullptr;
   }
 
   // The remainingTime is negative (include zero):
-  // 1. When the clock_time is larger than the latest video frame's endtime.
+  // 1. When the clockTime is larger than the latest video frame's endtime.
   // All the video frames should be rendered or dropped, nothing left in
   // VideoQueue. And since the VideoQueue is empty, we don't need to wake up
   // statemachine thread immediately, so set the remainingTime to default value.
-  // 2. Current frame's endtime is smaller than clock_time but there still exist
+  // 2. Current frame's endtime is smaller than clockTime but there still exist
   // newer frames in queue. Re-calculate the remainingTime.
   if (remainingTime <= 0) {
     VideoData* nextFrame = VideoQueue().PeekFront();
     if (nextFrame) {
-      remainingTime = nextFrame->mTime - clock_time;
+      remainingTime = nextFrame->mTime - clockTime;
     } else {
       remainingTime = AUDIO_DURATION_USECS;
     }
   }
 
   int64_t delay = remainingTime / mPlaybackRate;
   if (delay > 0) {
     ScheduleStateMachineIn(delay);