diff --git a/content/media/webaudio/AudioNode.cpp b/content/media/webaudio/AudioNode.cpp index 1aaa95338c3c..d90fd920ced5 100644 --- a/content/media/webaudio/AudioNode.cpp +++ b/content/media/webaudio/AudioNode.cpp @@ -176,7 +176,6 @@ AudioNode::Connect(AudioNode& aDestination, uint32_t aOutput, ps->AllocateInputPort(mStream, MediaInputPort::FLAG_BLOCK_INPUT, static_cast(aInput), static_cast(aOutput)); - aDestination.NotifyInputConnected(); } // This connection may have connected a panner and a source. diff --git a/content/media/webaudio/AudioNode.h b/content/media/webaudio/AudioNode.h index c2c23aaca8c6..6a60f6a579e4 100644 --- a/content/media/webaudio/AudioNode.h +++ b/content/media/webaudio/AudioNode.h @@ -199,8 +199,6 @@ public: void RemoveOutputParam(AudioParam* aParam); - virtual void NotifyInputConnected() {} - // MarkActive() asks the context to keep the AudioNode alive until the // context is finished. This takes care of "playing" references and // "tail-time" references. diff --git a/content/media/webaudio/ConvolverNode.cpp b/content/media/webaudio/ConvolverNode.cpp index bcd783cff0ca..a967f69173f2 100644 --- a/content/media/webaudio/ConvolverNode.cpp +++ b/content/media/webaudio/ConvolverNode.cpp @@ -126,9 +126,7 @@ public: mLeftOverData -= WEBAUDIO_BLOCK_SIZE; if (mLeftOverData <= 0) { // Note: this keeps spamming the main thread with messages as long - // as there is nothing to play. This isn't great, but it avoids - // problems with some messages being ignored when they're rejected by - // ConvolverNode::AcceptPlayingRefRelease. + // as there is nothing to play. This isn't great. mLeftOverData = 0; nsRefPtr refchanged = new PlayingRefChanged(aStream, PlayingRefChanged::RELEASE); @@ -175,7 +173,6 @@ ConvolverNode::ConvolverNode(AudioContext* aContext) 2, ChannelCountMode::Clamped_max, ChannelInterpretation::Speakers) - , mMediaStreamGraphUpdateIndexAtLastInputConnection(0) , mNormalize(true) { ConvolverNodeEngine* engine = new ConvolverNodeEngine(this, mNormalize); diff --git a/content/media/webaudio/ConvolverNode.h b/content/media/webaudio/ConvolverNode.h index 3c307802cc21..92505feedff1 100644 --- a/content/media/webaudio/ConvolverNode.h +++ b/content/media/webaudio/ConvolverNode.h @@ -56,21 +56,8 @@ public: } AudioNode::SetChannelCountModeValue(aMode, aRv); } - virtual void NotifyInputConnected() MOZ_OVERRIDE - { - mMediaStreamGraphUpdateIndexAtLastInputConnection = - mStream->Graph()->GetCurrentGraphUpdateIndex(); - } - bool AcceptPlayingRefRelease(int64_t aLastGraphUpdateIndexProcessed) const - { - // Reject any requests to release the playing ref if the request was issued - // before the MediaStreamGraph was aware of the most-recently-added input - // connection. - return aLastGraphUpdateIndexProcessed >= mMediaStreamGraphUpdateIndexAtLastInputConnection; - } private: - int64_t mMediaStreamGraphUpdateIndexAtLastInputConnection; nsRefPtr mBuffer; bool mNormalize; }; diff --git a/content/media/webaudio/DelayNode.cpp b/content/media/webaudio/DelayNode.cpp index 61f93e6305ce..b1e467be554d 100644 --- a/content/media/webaudio/DelayNode.cpp +++ b/content/media/webaudio/DelayNode.cpp @@ -95,8 +95,7 @@ public: } else if (mLeftOverData != INT32_MIN) { if (mLeftOverData <= 0) { // Continue spamming the main thread with messages until we are destroyed. - // This isn't great, but it ensures a message will get through even if - // some are ignored by DelayNode::AcceptPlayingRefRelease + // This isn't great. mLeftOverData = 0; playedBackAllLeftOvers = true; @@ -173,7 +172,6 @@ DelayNode::DelayNode(AudioContext* aContext, double aMaxDelay) 2, ChannelCountMode::Max, ChannelInterpretation::Speakers) - , mMediaStreamGraphUpdateIndexAtLastInputConnection(0) , mDelay(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(), SendDelayToStream, 0.0f)) { diff --git a/content/media/webaudio/DelayNode.h b/content/media/webaudio/DelayNode.h index 76438edb110e..9604e5f8777b 100644 --- a/content/media/webaudio/DelayNode.h +++ b/content/media/webaudio/DelayNode.h @@ -37,25 +37,11 @@ public: return this; } - virtual void NotifyInputConnected() MOZ_OVERRIDE - { - mMediaStreamGraphUpdateIndexAtLastInputConnection = - mStream->Graph()->GetCurrentGraphUpdateIndex(); - } - bool AcceptPlayingRefRelease(int64_t aLastGraphUpdateIndexProcessed) const - { - // Reject any requests to release the playing ref if the request was issued - // before the MediaStreamGraph was aware of the most-recently-added input - // connection. - return aLastGraphUpdateIndexProcessed >= mMediaStreamGraphUpdateIndexAtLastInputConnection; - } - private: static void SendDelayToStream(AudioNode* aNode); friend class DelayNodeEngine; private: - int64_t mMediaStreamGraphUpdateIndexAtLastInputConnection; nsRefPtr mDelay; }; diff --git a/content/media/webaudio/PlayingRefChangeHandler.h b/content/media/webaudio/PlayingRefChangeHandler.h index ed1ea07e8faf..abe5cf69faa0 100644 --- a/content/media/webaudio/PlayingRefChangeHandler.h +++ b/content/media/webaudio/PlayingRefChangeHandler.h @@ -19,8 +19,7 @@ class PlayingRefChangeHandler : public nsRunnable public: enum ChangeType { ADDREF, RELEASE }; PlayingRefChangeHandler(AudioNodeStream* aStream, ChangeType aChange) - : mLastProcessedGraphUpdateIndex(aStream->GetProcessingGraphUpdateIndex()) - , mStream(aStream) + : mStream(aStream) , mChange(aChange) { } @@ -39,8 +38,7 @@ public: if (node) { if (mChange == ADDREF) { node->MarkActive(); - } else if (mChange == RELEASE && - node->AcceptPlayingRefRelease(mLastProcessedGraphUpdateIndex)) { + } else if (mChange == RELEASE) { node->MarkInactive(); } } @@ -48,7 +46,6 @@ public: } private: - int64_t mLastProcessedGraphUpdateIndex; nsRefPtr mStream; ChangeType mChange; };