Bug 1314524. Part 6 - remove unused mPendingDormant.
MozReview-Commit-ID: 6B5mNoPk9tg
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -339,40 +339,34 @@ private:
void OnMetadataNotRead(const MediaResult& aError)
{
mMetadataRequest.Complete();
SWARN("Decode metadata failed, shutting down decoder");
mMaster->DecodeError(aError);
}
MozPromiseRequestHolder<MediaDecoderReader::MetadataPromise> mMetadataRequest;
-
- // True if we need to enter dormant state after reading metadata. Note that
- // we can't enter dormant state until reading metadata is done for some
- // limitations of the reader.
- bool mPendingDormant = false;
};
/**
* Purpose: wait for the CDM to start decoding.
*
* Transition to other states when CDM is ready:
* DORMANT if any pending dormant request.
* DECODING_FIRSTFRAME otherwise.
*/
class MediaDecoderStateMachine::WaitForCDMState
: public MediaDecoderStateMachine::StateObject
{
public:
explicit WaitForCDMState(Master* aPtr) : StateObject(aPtr) {}
- void Enter(bool aPendingDormant)
+ void Enter()
{
MOZ_ASSERT(!mMaster->mVideoDecodeSuspended);
- mPendingDormant = aPendingDormant;
}
void Exit() override
{
// mPendingSeek is either moved in HandleCDMProxyReady() or should be
// rejected here before transition to SHUTDOWN.
mPendingSeek.RejectIfExists(__func__);
}
@@ -399,17 +393,16 @@ public:
void HandleResumeVideoDecoding() override
{
// We never suspend video decoding in this state.
MOZ_ASSERT(false, "Shouldn't have suspended video decoding.");
}
private:
- bool mPendingDormant = false;
SeekJob mPendingSeek;
};
/**
* Purpose: release decoder resources to save memory and hardware resources.
*
* Transition to:
* DECODING_FIRSTFRAME when play state changes to PLAYING.
@@ -1297,19 +1290,17 @@ DecodeMetadataState::OnMetadataRead(Meta
if (mMaster->mNotifyMetadataBeforeFirstFrame) {
mMaster->EnqueueLoadedMetadataEvent();
}
if (waitingForCDM) {
// Metadata parsing was successful but we're still waiting for CDM caps
// to become available so that we can build the correct decryptor/decoder.
- SetState<WaitForCDMState>(mPendingDormant);
- } else if (mPendingDormant) {
- SetState<DormantState>(SeekJob{});
+ SetState<WaitForCDMState>();
} else {
SetState<DecodingFirstFrameState>(SeekJob{});
}
}
RefPtr<MediaDecoder::SeekPromise>
MediaDecoderStateMachine::
DormantState::HandleSeek(SeekTarget aTarget)
@@ -1331,21 +1322,17 @@ DormantState::HandlePlayStateChanged(Med
SetState<DecodingFirstFrameState>(Move(mPendingSeek));
}
}
bool
MediaDecoderStateMachine::
WaitForCDMState::HandleCDMProxyReady()
{
- if (mPendingDormant) {
- SetState<DormantState>(Move(mPendingSeek));
- } else {
- SetState<DecodingFirstFrameState>(Move(mPendingSeek));
- }
+ SetState<DecodingFirstFrameState>(Move(mPendingSeek));
return true;
}
void
MediaDecoderStateMachine::
DecodingFirstFrameState::Enter(SeekJob aPendingSeek)
{
// Handle pending seek.