Bug 1499426 - Only create AudioInputProcessing once in MediaEngineWebRTCAudio::Start. r=pehrsons a=jcristau
authorPaul Adenot <paul@paul.cx>
Mon, 05 Nov 2018 11:23:39 +0100
changeset 501039 9aacd377517c9d54df39a717b6f474e3666389ef
parent 501038 8016d0d1a391f1327a0375fb6d4f20228b2784aa
child 501040 2b2c323a635295870bfc3d4e5bf511185857a36e
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons, jcristau
bugs1499426
milestone64.0
Bug 1499426 - Only create AudioInputProcessing once in MediaEngineWebRTCAudio::Start. r=pehrsons a=jcristau
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));