Bug 1312886: [MSE] P3. Only rely on waiting promise to determine buffering state. r?jwwang
MozReview-Commit-ID: 3HfK8bwqlYM
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1464,24 +1464,21 @@ DecodingState::MaybeStartBuffering()
}
// Don't enter buffering while prerolling so that the decoder has a chance to
// enqueue some decoded data before we give up and start buffering.
if (!mMaster->IsPlaying()) {
return;
}
- // No more data to download. No need to enter buffering.
- if (!Resource()->IsExpectingMoreData()) {
- return;
- }
-
bool shouldBuffer;
if (Reader()->UseBufferingHeuristics()) {
- shouldBuffer = mMaster->HasLowDecodedData() && mMaster->HasLowBufferedData();
+ shouldBuffer = Resource()->IsExpectingMoreData() &&
+ mMaster->HasLowDecodedData() &&
+ mMaster->HasLowBufferedData();
} else {
MOZ_ASSERT(Reader()->IsWaitForDataSupported());
shouldBuffer =
(mMaster->OutOfDecodedAudio() && Reader()->IsWaitingAudioData()) ||
(mMaster->OutOfDecodedVideo() && Reader()->IsWaitingVideoData());
}
if (shouldBuffer) {
SetState<BufferingState>();