Bug 1189506. No need to pass aNextCurrentTime to UpdateCurrentTimeForStreams. r=karlt
authorRobert O'Callahan <robert@ocallahan.org>
Sat, 05 Sep 2015 00:42:53 +1200
changeset 297217 e09858e37a65770cc21af64aea1756b0740b00fa
parent 297216 f38cc960f179b0e5907b0ad947f42410484905fd
child 297218 67cadfca5bbd9caaf70c1826ff53f63ab5bb9280
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1189506
milestone43.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 1189506. No need to pass aNextCurrentTime to UpdateCurrentTimeForStreams. r=karlt
dom/media/MediaStreamGraph.cpp
dom/media/MediaStreamGraphImpl.h
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -291,40 +291,39 @@ MediaStreamGraphImpl::StreamReadyToFinis
     for (uint32_t j = 0; j < aStream->mListeners.Length(); ++j) {
       MediaStreamListener* l = aStream->mListeners[j];
       l->NotifyEvent(this, MediaStreamListener::EVENT_FINISHED);
     }
   }
 }
 
 void
-MediaStreamGraphImpl::UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime,
-                                                  GraphTime aNextCurrentTime)
+MediaStreamGraphImpl::UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime)
 {
   for (MediaStream* stream : AllStreams()) {
     // Calculate blocked time and fire Blocked/Unblocked events
-    GraphTime blockedTime = aNextCurrentTime - stream->mStartBlocking;
+    GraphTime blockedTime = mStateComputedTime - stream->mStartBlocking;
     NS_ASSERTION(blockedTime >= 0, "Error in blocking time");
 
     if (stream->mStartBlocking > aPrevCurrentTime && stream->mNotifiedBlocked) {
       for (uint32_t j = 0; j < stream->mListeners.Length(); ++j) {
         MediaStreamListener* l = stream->mListeners[j];
         l->NotifyBlockingChanged(this, MediaStreamListener::UNBLOCKED);
       }
       stream->mNotifiedBlocked = false;
     }
-    if (stream->mStartBlocking < aNextCurrentTime && !stream->mNotifiedBlocked) {
+    if (stream->mStartBlocking < mStateComputedTime && !stream->mNotifiedBlocked) {
       for (uint32_t j = 0; j < stream->mListeners.Length(); ++j) {
         MediaStreamListener* l = stream->mListeners[j];
         l->NotifyBlockingChanged(this, MediaStreamListener::BLOCKED);
       }
       stream->mNotifiedBlocked = true;
     }
 
-    stream->AdvanceTimeVaryingValuesToCurrentTime(aNextCurrentTime,
+    stream->AdvanceTimeVaryingValuesToCurrentTime(mStateComputedTime,
                                                   blockedTime);
 
     STREAM_LOG(LogLevel::Verbose,
                ("MediaStream %p bufferStartTime=%f blockedTime=%f", stream,
                 MediaTimeToSeconds(stream->mBufferStartTime),
                 MediaTimeToSeconds(blockedTime)));
 
     bool streamHasOutput = stream->mStartBlocking > aPrevCurrentTime;
@@ -1257,17 +1256,17 @@ MediaStreamGraphImpl::OneIteration(Graph
   UpdateGraph(stateEnd);
 
   mStateComputedTime = stateEnd;
 
   Process(stateFrom, stateEnd);
 
   mProcessedTime = stateEnd;
 
-  UpdateCurrentTimeForStreams(stateFrom, stateEnd);
+  UpdateCurrentTimeForStreams(stateFrom);
 
   return UpdateMainThreadState();
 }
 
 void
 MediaStreamGraphImpl::ApplyStreamUpdate(StreamUpdate* aUpdate)
 {
   mMonitor.AssertCurrentThreadOwns();
--- a/dom/media/MediaStreamGraphImpl.h
+++ b/dom/media/MediaStreamGraphImpl.h
@@ -216,20 +216,19 @@ public:
   /**
    * If we are rendering in non-realtime mode, we don't want to send messages to
    * the main thread at each iteration for performance reasons. We instead
    * notify the main thread at the same rate
    */
   bool ShouldUpdateMainThread();
   // The following methods are the various stages of RunThread processing.
   /**
-   * Advance all stream state to the new current time.
+   * Advance all stream state to mStateComputedTime.
    */
-  void UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime,
-                                   GraphTime aNextCurrentTime);
+  void UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime);
   /**
    * Process graph message for this iteration, update stream processing order,
    * and recompute stream blocking until aEndBlockingDecisions.
    */
   void UpdateGraph(GraphTime aEndBlockingDecisions);
 
   void SwapMessageQueues()
   {