Bug 865247 - Part 2: Tell MediaInputPorts about their input and output ports; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 05 May 2013 11:47:59 -0400
changeset 141842 c619b0cb55f0c694a4fc79d99eadecd27ad68c59
parent 141841 0630975bebd60c00d02a062db0ae31bd09695e1e
child 141843 d6307d661d41c7657b17300b777ede8e9e9f6b2d
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs865247
milestone23.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 865247 - Part 2: Tell MediaInputPorts about their input and output ports; r=roc
content/media/webaudio/AudioNode.cpp
--- a/content/media/webaudio/AudioNode.cpp
+++ b/content/media/webaudio/AudioNode.cpp
@@ -163,18 +163,22 @@ AudioNode::Connect(AudioNode& aDestinati
   input->mInputNode = this;
   input->mInputPort = aInput;
   input->mOutputPort = aOutput;
   if (aDestination.mStream) {
     // Connect streams in the MediaStreamGraph
     MOZ_ASSERT(aDestination.mStream->AsProcessedStream());
     ProcessedMediaStream* ps =
       static_cast<ProcessedMediaStream*>(aDestination.mStream.get());
+    MOZ_ASSERT(aInput <= UINT16_MAX, "Unexpected large input port number");
+    MOZ_ASSERT(aOutput <= UINT16_MAX, "Unexpected large output port number");
     input->mStreamPort =
-      ps->AllocateInputPort(mStream, MediaInputPort::FLAG_BLOCK_INPUT);
+      ps->AllocateInputPort(mStream, MediaInputPort::FLAG_BLOCK_INPUT,
+                            static_cast<uint16_t>(aInput),
+                            static_cast<uint16_t>(aOutput));
   }
 
   // This connection may have connected a panner and a source.
   Context()->UpdatePannerSource();
 }
 
 void
 AudioNode::Connect(AudioParam& aDestination, uint32_t aOutput,
@@ -202,17 +206,19 @@ AudioNode::Connect(AudioParam& aDestinat
   input->mInputPort = INVALID_PORT;
   input->mOutputPort = aOutput;
 
   MediaStream* stream = aDestination.Stream();
   MOZ_ASSERT(stream->AsProcessedStream());
   ProcessedMediaStream* ps = static_cast<ProcessedMediaStream*>(stream);
 
   // Setup our stream as an input to the AudioParam's stream
-  input->mStreamPort = ps->AllocateInputPort(mStream, MediaInputPort::FLAG_BLOCK_INPUT);
+  MOZ_ASSERT(aOutput <= UINT16_MAX, "Unexpected large output port number");
+  input->mStreamPort = ps->AllocateInputPort(mStream, MediaInputPort::FLAG_BLOCK_INPUT,
+                                             0, static_cast<uint16_t>(aOutput));
 }
 
 void
 AudioNode::SendDoubleParameterToStream(uint32_t aIndex, double aValue)
 {
   AudioNodeStream* ns = static_cast<AudioNodeStream*>(mStream.get());
   MOZ_ASSERT(ns, "How come we don't have a stream here?");
   ns->SetDoubleParameter(aIndex, aValue);