Bug 1399358 - call mDecoder->CanPlayThrough() so MDSM has a chance to exit buffering quickly. r=gerald

MozReview-Commit-ID: A5e3A8HV2ih
This commit is contained in:
JW Wang
2017-09-13 12:43:33 +08:00
parent ee656c6252
commit e154ae23d6

View File

@@ -5780,6 +5780,13 @@ 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;
}