Bug 1601385 - Don't continue UpdateOutputTrackSources if the tracks-captured state changed. r=jib

Changing the tracks-captured state will trigger another run of
UpdateOutputTrackSources, so continuing the current one is futile. The next run
will properly re-evaluate all input state to this function.

Differential Revision: https://phabricator.services.mozilla.com/D100004
This commit is contained in:
Andreas Pehrson
2021-01-12 09:35:20 +00:00
parent 076e1cda0e
commit eccd8c0312

View File

@@ -3686,6 +3686,9 @@ void HTMLMediaElement::UpdateOutputTrackSources() {
mOutputStreams.RemoveElementAt(i);
if (mOutputStreams.IsEmpty()) {
mTracksCaptured = nullptr;
// mTracksCaptured is one of the Watchables triggering this method.
// Unsetting it here means we'll run through this method again very soon.
return;
}
}