Bug 1329075 - Fix assertion failure in debug build. r=jesup

With the attached test case I was failing an assert in a debug build because
NotifyMediaTrackEnabled exited early due to `mReadyState == HAVE_NOTHING` but
NotifyMediaTrackDisabled didn't. The latter would fail an assert.

MozReview-Commit-ID: 7Frpj62s0Bc

--HG--
extra : rebase_source : a1dea4f2db564fe28e6eb7f7fcd9c382a46409ac
This commit is contained in:
Andreas Pehrson 2017-01-09 16:36:00 +01:00
Родитель a094533751
Коммит 13c708b237
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -2023,6 +2023,12 @@ void HTMLMediaElement::NotifyMediaTrackDisabled(MediaTrack* aTrack)
}
}
if (mReadyState == HAVE_NOTHING) {
// No MediaStreamTracks are captured until we have metadata, and code
// below doesn't do anything for captured decoders.
return;
}
for (OutputMediaStream& ms : mOutputStreams) {
if (ms.mCapturingDecoder) {
MOZ_ASSERT(!ms.mCapturingMediaStream);