From fcb5a01a17bcdaba3cb02241afef8be3aca62e21 Mon Sep 17 00:00:00 2001 From: JW Wang Date: Wed, 23 Nov 2016 17:56:12 +0800 Subject: [PATCH] Bug 1319706. Part 2 - remove the SeekJob parameter from DecodingFirstFrameState::Enter(). r=kaku MozReview-Commit-ID: ACea0NLMRLn --HG-- extra : rebase_source : 1696a46a421d22262ae048ff5328e6643b4bad9b extra : intermediate-source : 3798077282652f1603946c95a46d9922c6bb387c extra : source : be5b5a3e81dee3880f0a82cb0d3fc08564328e45 --- dom/media/MediaDecoderStateMachine.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index c64f34db5402..9a36be3bcb57 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -348,6 +348,7 @@ private: * Purpose: wait for the CDM to start decoding. * * Transition to other states when CDM is ready: + * SEEKING if any pending seek request. * DECODING_FIRSTFRAME otherwise. */ class MediaDecoderStateMachine::WaitForCDMState @@ -471,7 +472,7 @@ class MediaDecoderStateMachine::DecodingFirstFrameState public: explicit DecodingFirstFrameState(Master* aPtr) : StateObject(aPtr) {} - void Enter(SeekJob aPendingSeek); + void Enter(); State GetState() const override { @@ -1271,7 +1272,7 @@ DecodeMetadataState::OnMetadataRead(MetadataHolder* aMetadata) // to become available so that we can build the correct decryptor/decoder. SetState(); } else { - SetState(SeekJob{}); + SetState(); } } @@ -1291,19 +1292,17 @@ void MediaDecoderStateMachine:: WaitForCDMState::HandleCDMProxyReady() { - SetState(Move(mPendingSeek)); + if (mPendingSeek.Exists()) { + SetState(Move(mPendingSeek), EventVisibility::Observable); + } else { + SetState(); + } } void MediaDecoderStateMachine:: -DecodingFirstFrameState::Enter(SeekJob aPendingSeek) +DecodingFirstFrameState::Enter() { - // Handle pending seek. - if (aPendingSeek.Exists()) { - SetState(Move(aPendingSeek), EventVisibility::Observable); - return; - } - // Transition to DECODING if we've decoded first frames. if (mMaster->mSentFirstFrameLoadedEvent) { SetState();