Bug 1499426 - Only create AudioInputProcessing once in MediaEngineWebRTCAudio::Start. r=pehrsons
☠☠ backed out by 957a743c4ca2 ☠ ☠
authorPaul Adenot <paul@paul.cx>
Mon, 05 Nov 2018 11:23:39 +0100
changeset 444552 ecb1ebb963155e84185700424c4af0f4f03562ff
parent 444551 c27b21d98ce4c497aede277dce8bcd058ba3b886
child 444553 4571b6b06612c509dd1268c07a4d35aba108e833
push id34997
push userrgurzau@mozilla.com
push dateTue, 06 Nov 2018 09:59:47 +0000
treeherdermozilla-central@957a743c4ca2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1499426
milestone65.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 1499426 - Only create AudioInputProcessing once in MediaEngineWebRTCAudio::Start. r=pehrsons
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -649,18 +649,20 @@ MediaEngineWebRTCMicrophoneSource::Start
       mStream->GraphImpl()->InputDeviceID() != deviceID) {
     // For now, we only allow opening a single audio input device per document,
     // because we can only have one MSG per document.
     return NS_ERROR_FAILURE;
   }
 
 
 
-  mInputProcessing = new AudioInputProcessing(
-    mDeviceMaxChannelCount, mStream, mTrackID, mPrincipal);
+  if (!mInputProcessing) {
+    mInputProcessing = new AudioInputProcessing(
+      mDeviceMaxChannelCount, mStream, mTrackID, mPrincipal);
+  }
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   RefPtr<MediaStreamGraphImpl> gripGraph = mStream->GraphImpl();
   NS_DispatchToMainThread(media::NewRunnableFrom(
     [that, graph = std::move(gripGraph), deviceID]() mutable {
       if (graph) {
         graph->AppendMessage(MakeUnique<StartStopMessage>(
           that->mInputProcessing, StartStopMessage::Start));