Bug 1402377 - Stop the corresponding track instead of the whole stream when an external device is plugged out. r?jib, pehrsons draft
authorMunro Mengjue Chiang <mchiang@mozilla.com>
Wed, 27 Sep 2017 10:16:46 +0800
changeset 672426 e955012bea1270df4da4ec07864a59e4c659f2f8
parent 658358 8e05298328da75f3056a9f1f9609938870d756a0
child 733786 eaade696005856ff9d09ebc05dd8542437344556
push id82229
push userbmo:mchiang@mozilla.com
push dateFri, 29 Sep 2017 03:44:27 +0000
reviewersjib, pehrsons
bugs1402377
milestone57.0a1
Bug 1402377 - Stop the corresponding track instead of the whole stream when an external device is plugged out. r?jib, pehrsons MozReview-Commit-ID: 7gbB5sgn6xI
dom/media/MediaManager.cpp
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -4046,24 +4046,24 @@ GetUserMediaWindowListener::StopRawID(co
 {
   MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread");
 
   for (auto& source : mActiveListeners) {
     if (source->GetAudioDevice()) {
       nsString id;
       source->GetAudioDevice()->GetRawId(id);
       if (removedDeviceID.Equals(id)) {
-        source->Stop();
+        source->StopTrack(kAudioTrack);
       }
     }
     if (source->GetVideoDevice()) {
       nsString id;
       source->GetVideoDevice()->GetRawId(id);
       if (removedDeviceID.Equals(id)) {
-        source->Stop();
+        source->StopTrack(kVideoTrack);
       }
     }
   }
 }
 
 void
 GetUserMediaWindowListener::NotifySourceTrackStopped()
 {