Bug 1185176 - Account for the fact that it is possible for nodes to not have streams. r=karlt, a=ritu
authorPaul Adenot <paul@paul.cx>
Fri, 24 Jul 2015 15:09:19 +0200
changeset 269063 11446d89a3ad8b4ae50b277394f3616495e1a964
parent 269062 8cf5636886f0c32c3538c6988b83a5b3dcfffd59
child 269064 2215ae5f74061f555d4df8d95282544bbfad5509
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt, ritu
bugs1185176
milestone41.0a2
Bug 1185176 - Account for the fact that it is possible for nodes to not have streams. r=karlt, a=ritu We can now destroy a stream earlier than the node for performance reasons.
dom/media/webaudio/AudioNode.cpp
--- a/dom/media/webaudio/AudioNode.cpp
+++ b/dom/media/webaudio/AudioNode.cpp
@@ -289,19 +289,20 @@ AudioNode::SendThreeDPointParameterToStr
 {
   MOZ_ASSERT(mStream, "How come we don't have a stream here?");
   mStream->SetThreeDPointParameter(aIndex, aValue);
 }
 
 void
 AudioNode::SendChannelMixingParametersToStream()
 {
-  MOZ_ASSERT(mStream, "How come we don't have a stream here?");
-  mStream->SetChannelMixingParameters(mChannelCount, mChannelCountMode,
-                                 mChannelInterpretation);
+  if (mStream) {
+    mStream->SetChannelMixingParameters(mChannelCount, mChannelCountMode,
+                                        mChannelInterpretation);
+  }
 }
 
 void
 AudioNode::SendTimelineParameterToStream(AudioNode* aNode, uint32_t aIndex,
                                          const AudioParamTimeline& aValue)
 {
   AudioNodeStream* ns = aNode->mStream;
   MOZ_ASSERT(ns, "How come we don't have a stream here?");
@@ -422,14 +423,15 @@ AudioNode::PassThrough() const
   return mPassThrough;
 }
 
 void
 AudioNode::SetPassThrough(bool aPassThrough)
 {
   MOZ_ASSERT(NumberOfInputs() <= 1 && NumberOfOutputs() == 1);
   mPassThrough = aPassThrough;
-  MOZ_ASSERT(mStream, "How come we don't have a stream here?");
-  mStream->SetPassThrough(mPassThrough);
+  if (mStream) {
+    mStream->SetPassThrough(mPassThrough);
+  }
 }
 
 }
 }