Bug 1258271 - Remove arguments from MediaDecoderStateMachine::HaveEnoughDecodedAudio(). r=bechen.

MozReview-Commit-ID: E0qE18TmNH0
This commit is contained in:
JW Wang 2016-03-21 17:23:30 +08:00
parent 35e5eec178
commit cc2cdd3cd6
2 changed files with 6 additions and 7 deletions

View File

@ -460,12 +460,13 @@ void MediaDecoderStateMachine::DiscardStreamData()
}
}
bool MediaDecoderStateMachine::HaveEnoughDecodedAudio(int64_t aAmpleAudioUSecs)
bool MediaDecoderStateMachine::HaveEnoughDecodedAudio()
{
MOZ_ASSERT(OnTaskQueue());
int64_t ampleAudioUSecs = mAmpleAudioThresholdUsecs * mPlaybackRate;
if (AudioQueue().GetSize() == 0 ||
GetDecodedAudioDuration() < aAmpleAudioUSecs) {
GetDecodedAudioDuration() < ampleAudioUSecs) {
return false;
}
@ -562,14 +563,12 @@ MediaDecoderStateMachine::NeedToDecodeAudio()
{
MOZ_ASSERT(OnTaskQueue());
SAMPLE_LOG("NeedToDecodeAudio() isDec=%d minPrl=%d enufAud=%d",
IsAudioDecoding(), mMinimizePreroll,
HaveEnoughDecodedAudio(mAmpleAudioThresholdUsecs * mPlaybackRate));
IsAudioDecoding(), mMinimizePreroll, HaveEnoughDecodedAudio());
return IsAudioDecoding() &&
mState != DECODER_STATE_SEEKING &&
((IsDecodingFirstFrame() && AudioQueue().GetSize() == 0) ||
(!mMinimizePreroll &&
!HaveEnoughDecodedAudio(mAmpleAudioThresholdUsecs * mPlaybackRate)));
(!mMinimizePreroll && !HaveEnoughDecodedAudio()));
}
bool

View File

@ -340,7 +340,7 @@ private:
// Discard audio/video data that are already played by MSG.
void DiscardStreamData();
bool HaveEnoughDecodedAudio(int64_t aAmpleAudioUSecs);
bool HaveEnoughDecodedAudio();
bool HaveEnoughDecodedVideo();
// Returns true if the state machine has shutdown or is in the process of