Bug 1452993 - Get MSG instance from MediaStream to avoid the risk of creating new instance. r?padenot draft
authorAlex Chronopoulos <achronop@gmail.com>
Tue, 10 Apr 2018 18:06:32 +0300
changeset 779763 3049355b441d530cc415620fb6724ddfbab279fa
parent 779762 e4f128a7a210aa4d255a4e0b09332e0fa7350b08
push id105863
push userachronop@gmail.com
push dateTue, 10 Apr 2018 15:08:41 +0000
reviewerspadenot
bugs1452993
milestone61.0a1
Bug 1452993 - Get MSG instance from MediaStream to avoid the risk of creating new instance. r?padenot MozReview-Commit-ID: F1R4FCEe1Gf
dom/media/MediaManager.cpp
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -4391,19 +4391,17 @@ SourceListener::StopSharing()
     StopTrack(kVideoTrack);
   }
   if (mAudioDeviceState &&
       mAudioDeviceState->mDevice->GetMediaSource() == MediaSourceEnum::AudioCapture) {
     uint64_t windowID = mWindowListener->WindowID();
     nsCOMPtr<nsPIDOMWindowInner> window = nsGlobalWindowInner::GetInnerWindowWithId(windowID)->AsInner();
     MOZ_RELEASE_ASSERT(window);
     window->SetAudioCapture(false);
-    MediaStreamGraph* graph =
-      MediaStreamGraph::GetInstance(MediaStreamGraph::AUDIO_THREAD_DRIVER, window,
-                                    MediaStreamGraph::REQUEST_DEFAULT_SAMPLE_RATE);
+    MediaStreamGraph* graph = mStream->Graph();
     graph->UnregisterCaptureStreamForWindow(windowID);
     mStream->Destroy();
   }
 }
 
 SourceMediaStream*
 SourceListener::GetSourceStream()
 {