Bug 1422677. P2 - remove the side effect of MediaDecoder::CanPlayThrough(). r=bechen,gerald

We calculate 'canplaythrough' in ChannelMediaDecoder::DownloadProgressed() and
send updates to MDSM.

MozReview-Commit-ID: KAeDciPAUKs
This commit is contained in:
JW Wang
2017-12-01 14:34:58 +08:00
parent 29c53d1bf1
commit f96c236ca3
3 changed files with 4 additions and 13 deletions

View File

@@ -6010,13 +6010,6 @@ HTMLMediaElement::UpdateReadyStateInternal()
if (nextFrameStatus == NEXT_FRAME_UNAVAILABLE_BUFFERING) {
// Force HAVE_CURRENT_DATA when buffering.
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA);
if (mDecoder) {
// The side effect of CanPlayThrough() will update mCanPlayThrough of
// MDSM so it has a chance to exit buffering quickly.
// TODO: This implicit coupling is bad. Refactoring should be done
// to remove the side effect of CanPlayThrough().
mDecoder->CanPlayThrough();
}
return;
}