bug 1207003 remove unnecessary EnsureTrack() call r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Wed, 09 Sep 2015 18:41:50 +1200
changeset 263941 ccec05c4554b071a66731502a2a1ba9766564594
parent 263940 f721299f9dcaa6ee9139c6c84059f82c2996f26c
child 263942 b6ef4e4af23ad722085ea78d29c316d11efaa517
push id65483
push userktomlinson@mozilla.com
push dateWed, 23 Sep 2015 10:45:32 +0000
treeherdermozilla-inbound@15e7ac19b26e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1207003
milestone44.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 1207003 remove unnecessary EnsureTrack() call r=padenot EnsureTrack() will be called in AdvanceOutputSegment(), if not blocked.
dom/media/webaudio/AudioNodeStream.cpp
--- a/dom/media/webaudio/AudioNodeStream.cpp
+++ b/dom/media/webaudio/AudioNodeStream.cpp
@@ -508,22 +508,16 @@ AudioNodeStream::UpMixDownMixChunk(const
   }
 }
 
 // The MediaStreamGraph guarantees that this is actually one block, for
 // AudioNodeStreams.
 void
 AudioNodeStream::ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags)
 {
-  if (!mFinished) {
-    EnsureTrack(AUDIO_TRACK);
-  }
-  // No more tracks will be coming
-  mBuffer.AdvanceKnownTracksTime(STREAM_TIME_MAX);
-
   uint16_t outputCount = mLastChunks.Length();
   MOZ_ASSERT(outputCount == std::max(uint16_t(1), mEngine->OutputCount()));
 
   if (!mIsActive) {
     // mLastChunks are already null.
 #ifdef DEBUG
     for (const auto& chunk : mLastChunks) {
       MOZ_ASSERT(chunk.IsNull());
@@ -600,16 +594,19 @@ AudioNodeStream::ProduceOutputBeforeInpu
     }
   }
 }
 
 void
 AudioNodeStream::AdvanceOutputSegment()
 {
   StreamBuffer::Track* track = EnsureTrack(AUDIO_TRACK);
+  // No more tracks will be coming
+  mBuffer.AdvanceKnownTracksTime(STREAM_TIME_MAX);
+
   AudioSegment* segment = track->Get<AudioSegment>();
 
   if (mFlags & EXTERNAL_OUTPUT) {
     segment->AppendAndConsumeChunk(mLastChunks[0].AsMutableChunk());
   } else {
     segment->AppendNullData(mLastChunks[0].GetDuration());
   }