Bug 1172394 - Always mark a MediaStreamAudioSourceNode attached to a live track as active. r=padenot
authorAndreas Pehrson <apehrson@mozilla.com>
Thu, 14 Nov 2019 14:33:44 +0000
changeset 501961 ae3cd36f38f669205933cb5c54e3e9a1b4144d99
parent 501960 2d4bb8556f0815eb766b781b9d0bf9e086d2cc0d
child 501962 2516219862e8105ea4a782aaf4b55abfed95ca43
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1172394
milestone72.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 1172394 - Always mark a MediaStreamAudioSourceNode attached to a live track as active. r=padenot Differential Revision: https://phabricator.services.mozilla.com/D52049
dom/media/webaudio/MediaStreamAudioSourceNode.cpp
--- a/dom/media/webaudio/MediaStreamAudioSourceNode.cpp
+++ b/dom/media/webaudio/MediaStreamAudioSourceNode.cpp
@@ -114,16 +114,17 @@ void MediaStreamAudioSourceNode::AttachT
   }
 
   mInputTrack = aTrack;
   ProcessedMediaTrack* outputTrack =
       static_cast<ProcessedMediaTrack*>(mTrack.get());
   mInputPort = mInputTrack->ForwardTrackContentsTo(outputTrack);
   PrincipalChanged(mInputTrack);  // trigger enabling/disabling of the connector
   mInputTrack->AddPrincipalChangeObserver(this);
+  MarkActive();
 }
 
 void MediaStreamAudioSourceNode::DetachFromTrack() {
   if (mInputTrack) {
     mInputTrack->RemovePrincipalChangeObserver(this);
     mInputTrack = nullptr;
   }
   if (mInputPort) {
@@ -160,17 +161,16 @@ void MediaStreamAudioSourceNode::AttachT
     if (mBehavior == FollowChanges) {
       if (track->Ended()) {
         continue;
       }
     }
 
     if (!track->Ended()) {
       AttachToTrack(track, aRv);
-      MarkActive();
     }
     return;
   }
 
   // There was no track available. We'll allow the node to be garbage collected.
   MarkInactive();
 }