Bug 1121342: Re-Request audio or video to decode first frame after a failed attempt. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 16 Jan 2015 15:48:40 +1100
changeset 224147 0bbf63496d8d7cbb6803aab4c8bed5f8b0595478
parent 224146 3bf791ce96e8be1c02b4c9bb67c107e7f6dc5170
child 224148 a801540e3d141aafd04b19a627fd2c9b6b10e3f4
push id54139
push userjyavenard@mozilla.com
push dateFri, 16 Jan 2015 09:23:23 +0000
treeherdermozilla-inbound@a801540e3d14 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1121342
milestone38.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
Bug 1121342: Re-Request audio or video to decode first frame after a failed attempt. r=cpearce
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -577,16 +577,18 @@ bool MediaDecoderStateMachine::HaveEnoug
 }
 
 bool
 MediaDecoderStateMachine::NeedToDecodeVideo()
 {
   AssertCurrentThreadInMonitor();
   return IsVideoDecoding() &&
          ((mState == DECODER_STATE_SEEKING && mDecodeToSeekTarget) ||
+          (mState == DECODER_STATE_DECODING_FIRSTFRAME &&
+           IsVideoDecoding() && VideoQueue().GetSize() == 0) ||
           (!mMinimizePreroll && !HaveEnoughDecodedVideo()));
 }
 
 bool
 MediaDecoderStateMachine::NeedToSkipToNextKeyframe()
 {
   AssertCurrentThreadInMonitor();
   if (mState == DECODER_STATE_DECODING_FIRSTFRAME) {
@@ -676,16 +678,18 @@ MediaDecoderStateMachine::NeedToDecodeAu
   AssertCurrentThreadInMonitor();
   SAMPLE_LOG("NeedToDecodeAudio() isDec=%d decToTar=%d minPrl=%d seek=%d enufAud=%d",
              IsAudioDecoding(), mDecodeToSeekTarget, mMinimizePreroll,
              mState == DECODER_STATE_SEEKING,
              HaveEnoughDecodedAudio(mAmpleAudioThresholdUsecs * mPlaybackRate));
 
   return IsAudioDecoding() &&
          ((mState == DECODER_STATE_SEEKING && mDecodeToSeekTarget) ||
+          (mState == DECODER_STATE_DECODING_FIRSTFRAME &&
+           IsAudioDecoding() && AudioQueue().GetSize() == 0) ||
           (!mMinimizePreroll &&
           !HaveEnoughDecodedAudio(mAmpleAudioThresholdUsecs * mPlaybackRate) &&
           (mState != DECODER_STATE_SEEKING || mDecodeToSeekTarget)));
 }
 
 void
 MediaDecoderStateMachine::DecodeAudio()
 {