Bug 1189506. Call GraphTimeToStreamTime in AudioNodeExternalInputStream. r=karlt
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 08 Sep 2015 16:46:10 +1200
changeset 295520 0bb138eeb4a35074af103b4c779edc8c1a033aeb
parent 295519 fbbbc7a0c7d66fe1b179dcbf01230889ab2fc96c
child 295521 fe7a41713e1db49dd50ff1ab8a6c5138910a38c4
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [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. Call GraphTimeToStreamTime in AudioNodeExternalInputStream. r=karlt
dom/media/webaudio/AudioNodeExternalInputStream.cpp
--- a/dom/media/webaudio/AudioNodeExternalInputStream.cpp
+++ b/dom/media/webaudio/AudioNodeExternalInputStream.cpp
@@ -149,29 +149,33 @@ AudioNodeExternalInputStream::ProcessInp
     GraphTime next;
     for (GraphTime t = aFrom; t < aTo; t = next) {
       MediaInputPort::InputInterval interval = mInputs[0]->GetNextInputInterval(t);
       interval.mEnd = std::min(interval.mEnd, aTo);
       if (interval.mStart >= interval.mEnd)
         break;
       next = interval.mEnd;
 
-      StreamTime outputStart = GraphTimeToStreamTimeWithBlocking(interval.mStart);
-      StreamTime outputEnd = GraphTimeToStreamTimeWithBlocking(interval.mEnd);
+      // We know this stream does not block during the processing interval ---
+      // we're not finished, we don't underrun, and we're not suspended.
+      StreamTime outputStart = GraphTimeToStreamTime(interval.mStart);
+      StreamTime outputEnd = GraphTimeToStreamTime(interval.mEnd);
       StreamTime ticks = outputEnd - outputStart;
 
       if (interval.mInputIsBlocked) {
         segment.AppendNullData(ticks);
       } else {
+        // The input stream is not blocked in this interval, so no need to call
+        // GraphTimeToStreamTimeWithBlocking.
         StreamTime inputStart =
           std::min(inputSegment.GetDuration(),
-                   source->GraphTimeToStreamTimeWithBlocking(interval.mStart));
+                   source->GraphTimeToStreamTime(interval.mStart));
         StreamTime inputEnd =
           std::min(inputSegment.GetDuration(),
-                   source->GraphTimeToStreamTimeWithBlocking(interval.mEnd));
+                   source->GraphTimeToStreamTime(interval.mEnd));
 
         segment.AppendSlice(inputSegment, inputStart, inputEnd);
         // Pad if we're looking past the end of the track
         segment.AppendNullData(ticks - (inputEnd - inputStart));
       }
     }
 
     for (AudioSegment::ChunkIterator iter(segment); !iter.IsEnded(); iter.Next()) {