b=1016177 don't create another AUDIO_TRACK after finishing r=roc
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 05 Jun 2014 10:11:52 +1200
changeset 207347 80d207a21b88667053b456eb0c8d43ab713b8837
parent 207346 9e1590531e5c902a4ec337db0f555da2363304f9
child 207348 58f1f6dbe7ce9b178e9fe300a66da93522b9d5de
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1016177
milestone32.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
b=1016177 don't create another AUDIO_TRACK after finishing r=roc
content/media/AudioNodeStream.cpp
--- a/content/media/AudioNodeStream.cpp
+++ b/content/media/AudioNodeStream.cpp
@@ -434,17 +434,19 @@ AudioNodeStream::UpMixDownMixChunk(const
   }
 }
 
 // The MediaStreamGraph guarantees that this is actually one block, for
 // AudioNodeStreams.
 void
 AudioNodeStream::ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags)
 {
-  EnsureTrack(AUDIO_TRACK, mSampleRate);
+  if (!mFinished) {
+    EnsureTrack(AUDIO_TRACK, mSampleRate);
+  }
   // No more tracks will be coming
   mBuffer.AdvanceKnownTracksTime(STREAM_TIME_MAX);
 
   uint16_t outputCount = std::max(uint16_t(1), mEngine->OutputCount());
   mLastChunks.SetLength(outputCount);
 
   // Consider this stream blocked if it has already finished output. Normally
   // mBlocked would reflect this, but due to rounding errors our audio track may
@@ -517,16 +519,17 @@ AudioNodeStream::AdvanceOutputSegment()
                                 mSampleRate, segment->GetDuration(), 0,
                                 tmpSegment);
   }
 }
 
 TrackTicks
 AudioNodeStream::GetCurrentPosition()
 {
+  NS_ASSERTION(!mFinished, "Don't create another track after finishing");
   return EnsureTrack(AUDIO_TRACK, mSampleRate)->Get<AudioSegment>()->GetDuration();
 }
 
 void
 AudioNodeStream::FinishOutput()
 {
   if (IsFinishedOnGraphThread()) {
     return;