Bug 1330889. Part 5 - remove MDSM::mState. r=kikuo

MozReview-Commit-ID: 648LWr4WU0F

--HG--
extra : rebase_source : 4135d2d76845cd2b90793b7bd1ba9176c39f80de
This commit is contained in:
JW Wang 2017-01-13 15:19:13 +08:00
parent 5cab9e2e2b
commit e34a7de0c4
2 changed files with 4 additions and 8 deletions

View File

@ -295,14 +295,13 @@ protected:
auto s = new S(master);
MOZ_ASSERT(master->mState != s->GetState() ||
master->mState == DECODER_STATE_SEEKING);
MOZ_ASSERT(GetState() != s->GetState() ||
GetState() == DECODER_STATE_SEEKING);
SLOG("change state to: %s", ToStateStr(s->GetState()));
Exit();
master->mState = s->GetState();
master->mStateObj.reset(s);
return s->Enter(Move(aArgs)...);
}
@ -2739,7 +2738,6 @@ nsresult MediaDecoderStateMachine::Init(MediaDecoder* aDecoder)
RefPtr<MediaDecoderStateMachine> self = this;
OwnerThread()->Dispatch(NS_NewRunnableFunction([self] () {
MOZ_ASSERT(self->mState == DECODER_STATE_DECODING_METADATA);
MOZ_ASSERT(!self->mStateObj);
auto s = new DecodeMetadataState(self);
self->mStateObj.reset(s);
@ -2835,7 +2833,7 @@ const char*
MediaDecoderStateMachine::ToStateStr()
{
MOZ_ASSERT(OnTaskQueue());
return ToStateStr(mState);
return ToStateStr(mStateObj->GetState());
}
void MediaDecoderStateMachine::VolumeChanged()
@ -3663,7 +3661,7 @@ MediaDecoderStateMachine::DumpDebugInfo()
mStateObj->DumpDebugInfo();
DUMP_LOG(
"GetMediaTime=%lld GetClock=%lld mMediaSink=%p "
"mState=%s mPlayState=%d mSentFirstFrameLoadedEvent=%d IsPlaying=%d "
"state=%s mPlayState=%d mSentFirstFrameLoadedEvent=%d IsPlaying=%d "
"mAudioStatus=%s mVideoStatus=%s mDecodedAudioEndTime=%lld mDecodedVideoEndTime=%lld "
"mAudioCompleted=%d mVideoCompleted=%d",
GetMediaTime(), mMediaSink->IsStarted() ? GetClock() : -1, mMediaSink.get(),

View File

@ -488,8 +488,6 @@ private:
// the decoder, state machine, and main threads.
MediaQueue<MediaData> mVideoQueue;
State mState = DECODER_STATE_DECODING_METADATA;
UniquePtr<StateObject> mStateObj;
media::TimeUnit Duration() const { MOZ_ASSERT(OnTaskQueue()); return mDuration.Ref().ref(); }