From 1dcbc7744ecc32e5768174c431cceab102729833 Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Wed, 9 Sep 2015 18:41:50 +1200 Subject: [PATCH] bug 1207003 remove unnecessary EnsureTrack() call r=padenot EnsureTrack() will be called in AdvanceOutputSegment(), if not blocked. --HG-- extra : rebase_source : 1fe290135e2314bc518e8f67b6a98eddc6cf7768 --- dom/media/webaudio/AudioNodeStream.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dom/media/webaudio/AudioNodeStream.cpp b/dom/media/webaudio/AudioNodeStream.cpp index 38311919ce61..b50a73b964cf 100644 --- a/dom/media/webaudio/AudioNodeStream.cpp +++ b/dom/media/webaudio/AudioNodeStream.cpp @@ -513,12 +513,6 @@ AudioNodeStream::UpMixDownMixChunk(const AudioBlock* aChunk, 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())); @@ -605,6 +599,9 @@ void AudioNodeStream::AdvanceOutputSegment() { StreamBuffer::Track* track = EnsureTrack(AUDIO_TRACK); + // No more tracks will be coming + mBuffer.AdvanceKnownTracksTime(STREAM_TIME_MAX); + AudioSegment* segment = track->Get(); if (mFlags & EXTERNAL_OUTPUT) {