author | JW Wang <jwwang@mozilla.com> |
Mon, 09 Jan 2017 20:37:06 +0800 | |
changeset 328840 | fca115e560c8c6b40948da510b8e938745a464bf |
parent 328839 | f914c3a64f8223d60061039f42fec2e565105a87 |
child 328841 | d1d89a3a187aa24845db5886cf0bc89747e2db5b |
push id | 31190 |
push user | cbook@mozilla.com |
push date | Wed, 11 Jan 2017 15:21:29 +0000 |
treeherder | mozilla-central@5493551203ed [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | kaku |
bugs | 1329897 |
milestone | 53.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -1688,18 +1688,16 @@ public: mMaster->mVideoDecodeSuspended = true; mMaster->mOnPlaybackEvent.Notify(MediaEventType::EnterVideoSuspend); Reader()->SetVideoBlankDecode(true); } } private: void DispatchDecodeTasksIfNeeded(); - void EnsureAudioDecodeTaskQueued(); - void EnsureVideoDecodeTaskQueued(); TimeStamp mBufferingStart; // The maximum number of second we spend buffering when we are short on // unbuffered data. const uint32_t mBufferingWait = 15; }; @@ -2243,48 +2241,28 @@ SeekingState::SeekCompleted() SetState<DecodingState>(); } void MediaDecoderStateMachine:: BufferingState::DispatchDecodeTasksIfNeeded() { if (mMaster->IsAudioDecoding() && - !mMaster->HaveEnoughDecodedAudio()) { - EnsureAudioDecodeTaskQueued(); + !mMaster->HaveEnoughDecodedAudio() && + !mMaster->IsRequestingAudioData() && + !mMaster->IsWaitingAudioData()) { + mMaster->RequestAudioData(); } if (mMaster->IsVideoDecoding() && - !mMaster->HaveEnoughDecodedVideo()) { - EnsureVideoDecodeTaskQueued(); - } -} - -void -MediaDecoderStateMachine:: -BufferingState::EnsureAudioDecodeTaskQueued() -{ - if (!mMaster->IsAudioDecoding() || - mMaster->IsRequestingAudioData() || - mMaster->IsWaitingAudioData()) { - return; + !mMaster->HaveEnoughDecodedVideo() && + !mMaster->IsRequestingVideoData() && + !mMaster->IsWaitingVideoData()) { + mMaster->RequestVideoData(false, media::TimeUnit()); } - mMaster->RequestAudioData(); -} - -void -MediaDecoderStateMachine:: -BufferingState::EnsureVideoDecodeTaskQueued() -{ - if (!mMaster->IsVideoDecoding() || - mMaster->IsRequestingVideoData() || - mMaster->IsWaitingVideoData()) { - return; - } - mMaster->RequestVideoData(false, media::TimeUnit()); } void MediaDecoderStateMachine:: BufferingState::Step() { TimeStamp now = TimeStamp::Now(); MOZ_ASSERT(!mBufferingStart.IsNull(), "Must know buffering start time.");