Bug 1408294 - Assert that NotifyPull produces data. r=padenot

MozReview-Commit-ID: CtC8A83iJgg

--HG--
extra : rebase_source : ada5a771164fafe35d22589956ced6f54545ee73
This commit is contained in:
Andreas Pehrson 2017-12-05 14:34:08 +01:00
Родитель 0ac2875a3d
Коммит ee75d2b969
2 изменённых файлов: 27 добавлений и 0 удалений

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

@ -3736,6 +3736,10 @@ SourceListener::Remove()
// If it's destroyed, don't call - listener will be removed and we'll be notified!
if (!mStream->IsDestroyed()) {
// We disable pulling before removing so we don't risk having live tracks
// without a listener attached - that wouldn't produce data and would be
// illegal to the graph.
mStream->SetPullEnabled(false);
mStream->RemoveListener(this);
}
}

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

@ -1185,6 +1185,29 @@ MediaStreamGraphImpl::UpdateGraph(GraphTime aEndBlockingDecisions)
}
} else {
stream->mStartBlocking = WillUnderrun(stream, aEndBlockingDecisions);
SourceMediaStream* s = stream->AsSourceStream();
if (s && s->mPullEnabled) {
for (StreamTracks::TrackIter i(s->mTracks); !i.IsEnded(); i.Next()) {
if (i->IsEnded()) {
continue;
}
if (i->GetEnd() < stream->GraphTimeToStreamTime(aEndBlockingDecisions)) {
LOG(LogLevel::Error,
("SourceMediaStream %p track %u (%s) is live and pulled, but wasn't fed "
"enough data. Listeners=%zu. Track-end=%f, Iteration-end=%f",
stream,
i->GetID(),
(i->GetType() == MediaSegment::AUDIO ? "audio" : "video"),
stream->mListeners.Length(),
MediaTimeToSeconds(i->GetEnd()),
MediaTimeToSeconds(stream->GraphTimeToStreamTime(aEndBlockingDecisions))));
MOZ_DIAGNOSTIC_ASSERT(false,
"A non-finished SourceMediaStream wasn't fed "
"enough data by NotifyPull");
}
}
}
}
}