Bug 1242843 - Make MDSM::mDecodedVideoEndTime zero-based. r=kikuo.
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -209,17 +209,17 @@ MediaDecoderStateMachine::MediaDecoderSt
mDispatchedStateMachine(false),
mDelayedScheduler(mTaskQueue),
mState(DECODER_STATE_DECODING_NONE, "MediaDecoderStateMachine::mState"),
mCurrentFrameID(0),
mObservedDuration(TimeUnit(), "MediaDecoderStateMachine::mObservedDuration"),
mFragmentEndTime(-1),
mReader(aReader),
mDecodedAudioEndTime(0),
- mDecodedVideoEndTime(-1),
+ mDecodedVideoEndTime(0),
mPlaybackRate(1.0),
mLowAudioThresholdUsecs(detail::LOW_AUDIO_USECS),
mAmpleAudioThresholdUsecs(detail::AMPLE_AUDIO_USECS),
mQuickBufferingLowDataThresholdUsecs(detail::QUICK_BUFFERING_LOW_DATA_USECS),
mIsAudioPrerolling(false),
mIsVideoPrerolling(false),
mAudioCaptured(false),
mAudioCompleted(false, "MediaDecoderStateMachine::mAudioCompleted"),
@@ -896,17 +896,17 @@ MediaDecoderStateMachine::MaybeFinishDec
void
MediaDecoderStateMachine::OnVideoDecoded(MediaData* aVideoSample)
{
MOZ_ASSERT(OnTaskQueue());
RefPtr<MediaData> video(aVideoSample);
MOZ_ASSERT(video);
mVideoDataRequest.Complete();
aVideoSample->AdjustForStartTime(StartTime());
- mDecodedVideoEndTime = video ? video->GetEndTime() : mDecodedVideoEndTime;
+ mDecodedVideoEndTime = video->GetEndTime();
SAMPLE_LOG("OnVideoDecoded [%lld,%lld] disc=%d",
(video ? video->mTime : -1),
(video ? video->GetEndTime() : -1),
(video ? video->mDiscontinuity : 0));
// Check frame validity here for every decoded frame in order to have a
// better chance to make the decision of turning off HW acceleration.
@@ -2384,17 +2384,17 @@ MediaDecoderStateMachine::Reset()
mState == DECODER_STATE_DORMANT ||
mState == DECODER_STATE_DECODING_NONE);
// Stop the audio thread. Otherwise, MediaSink might be accessing AudioQueue
// outside of the decoder monitor while we are clearing the queue and causes
// crash for no samples to be popped.
StopMediaSink();
- mDecodedVideoEndTime = -1;
+ mDecodedVideoEndTime = 0;
mDecodedAudioEndTime = 0;
mAudioCompleted = false;
mVideoCompleted = false;
AudioQueue().Reset();
VideoQueue().Reset();
mFirstVideoFrameAfterSeek = nullptr;
mDropAudioUntilNextDiscontinuity = true;
mDropVideoUntilNextDiscontinuity = true;