Bug 1325317. Part 2 - rename the function and fix comments.
MozReview-Commit-ID: 3GUkH5OpSmJ
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -427,17 +427,17 @@ public:
auto t = mMaster->mMediaSink->IsStarted()
? mMaster->GetClock()
: mMaster->GetMediaTime();
mPendingSeek.mTarget.emplace(t, SeekTarget::Accurate);
// SeekJob asserts |mTarget.IsValid() == !mPromise.IsEmpty()| so we
// need to create the promise even it is not used at all.
RefPtr<MediaDecoder::SeekPromise> x = mPendingSeek.mPromise.Ensure(__func__);
- mMaster->Reset();
+ mMaster->ResetDecode();
mMaster->StopMediaSink();
mMaster->mReader->ReleaseResources();
}
void Exit() override
{
// mPendingSeek is either moved when exiting dormant or
// should be rejected here before transition to SHUTDOWN.
@@ -967,19 +967,19 @@ private:
}
void DoSeek() override
{
mDoneAudioSeeking = !Info().HasAudio() || mSeekJob.mTarget->IsVideoOnly();
mDoneVideoSeeking = !Info().HasVideo();
if (mSeekJob.mTarget->IsVideoOnly()) {
- mMaster->Reset(TrackInfo::kVideoTrack);
+ mMaster->ResetDecode(TrackInfo::kVideoTrack);
} else {
- mMaster->Reset();
+ mMaster->ResetDecode();
mMaster->StopMediaSink();
}
DemuxerSeek();
}
int64_t CalculateNewCurrentTime() const override
{
@@ -2267,17 +2267,17 @@ ShutdownState::Enter()
master->StopPlayback();
}
master->mAudioDataRequest.DisconnectIfExists();
master->mVideoDataRequest.DisconnectIfExists();
master->mAudioWaitRequest.DisconnectIfExists();
master->mVideoWaitRequest.DisconnectIfExists();
- master->Reset();
+ master->ResetDecode();
master->StopMediaSink();
master->mMediaSink->Shutdown();
// Prevent dangling pointers by disconnecting the listeners.
master->mAudioQueueListener.Disconnect();
master->mVideoQueueListener.Disconnect();
master->mMetadataManager.Disconnect();
master->mOnMediaNotSeekable.Disconnect();
@@ -3362,17 +3362,17 @@ MediaDecoderStateMachine::RunStateMachin
MOZ_ASSERT(OnTaskQueue());
mDelayedScheduler.Reset(); // Must happen on state machine task queue.
mDispatchedStateMachine = false;
mStateObj->Step();
}
void
-MediaDecoderStateMachine::Reset(TrackSet aTracks)
+MediaDecoderStateMachine::ResetDecode(TrackSet aTracks)
{
MOZ_ASSERT(OnTaskQueue());
DECODER_LOG("MediaDecoderStateMachine::Reset");
// We should be resetting because we're seeking, shutting down, or entering
// dormant state. We could also be in the process of going dormant, and have
// just switched to exiting dormant before we finished entering dormant,
// hence the DECODING_NONE case below.
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -319,20 +319,20 @@ private:
// True if shutdown process has begun.
bool IsShutdown() const;
// Returns true if we're currently playing. The decoder monitor must
// be held.
bool IsPlaying() const;
- // Resets all state related to decoding and playback, emptying all buffers
- // and aborting all pending operations on the decode task queue.
- void Reset(TrackSet aTracks = TrackSet(TrackInfo::kAudioTrack,
- TrackInfo::kVideoTrack));
+ // Resets all states related to decoding and aborts all pending requests
+ // to the decoders.
+ void ResetDecode(TrackSet aTracks = TrackSet(TrackInfo::kAudioTrack,
+ TrackInfo::kVideoTrack));
protected:
virtual ~MediaDecoderStateMachine();
void BufferedRangeUpdated();
void ReaderSuspendedChanged();