Bug 1172394 - Always mark a MediaStreamAudioSourceNode attached to a live track as active. r=padenot
☠☠ backed out by 7272d77d4e80 ☠ ☠
authorAndreas Pehrson <apehrson@mozilla.com>
Wed, 13 Nov 2019 08:58:25 +0000
changeset 501794 a4f256e68ceff48ff088715a51ff793d880cd6e9
parent 501793 d0aa43657e8cb3f06eafe5c537dc64ff1499a353
child 501795 3ff0d72d23a267ace6188dcb339b06e7d09d51f2
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();
 }