Bug 1553262 - Ignore removing video tracks for streams that only capture audio. r=jib

Video tracks are not added to output streams that capture only audio, so we
cannot assume that an output stream that captures only audio has been locked to
capture MediaStream sources when a video track is removed.

Depends on D34854

Differential Revision: https://phabricator.services.mozilla.com/D34855
This commit is contained in:
Andreas Pehrson
2019-06-14 13:33:46 +00:00
parent 831a82660b
commit 6157f062c2

View File

@@ -2213,6 +2213,9 @@ void HTMLMediaElement::NotifyMediaTrackDisabled(MediaTrack* aTrack) {
MOZ_ASSERT(!ms.mCapturingMediaStream);
continue;
}
if (ms.mCapturingAudioOnly && aTrack->AsVideoTrack()) {
continue;
}
MOZ_ASSERT(ms.mCapturingMediaStream);
for (int32_t i = ms.mTrackPorts.Length() - 1; i >= 0; --i) {
if (ms.mTrackPorts[i].first() == aTrack->GetId()) {