Bug 1298594: P3. Ensure currentTime is updated prior changing readyState. r?jwwang
Otherwise we get intermittent in mochitests checking the value of currenTime when events are fired
MozReview-Commit-ID: AVktWrXochp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2537,16 +2537,22 @@ void MediaDecoderStateMachine::UpdateNex
statusString = "NEXT_FRAME_AVAILABLE";
} else {
status = MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
statusString = "NEXT_FRAME_UNAVAILABLE";
}
if (status != mNextFrameStatus) {
DECODER_LOG("Changed mNextFrameStatus to %s", statusString);
+ if(status == MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE_BUFFERING ||
+ status == MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE) {
+ // Ensure currentTime is up to date prior updating mNextFrameStatus so that
+ // the MediaDecoderOwner fire events at correct currentTime.
+ UpdatePlaybackPositionPeriodically();
+ }
}
mNextFrameStatus = status;
}
bool MediaDecoderStateMachine::JustExitedQuickBuffering()
{
MOZ_ASSERT(OnTaskQueue());