Bug 1233630 - Remove MediaDecoderStateMachine::AudioDecodedUsecs. r=kikuo.

This commit is contained in:
JW Wang 2015-12-24 10:00:47 +08:00
parent b3b65240bd
commit e7f2ec86d3
2 changed files with 2 additions and 20 deletions

View File

@ -412,7 +412,7 @@ bool MediaDecoderStateMachine::HasFutureAudio()
// we've completely decoded all audio (but not finished playing it yet
// as per 1).
return !mAudioCompleted &&
(AudioDecodedUsecs() >
(GetDecodedAudioDuration() >
mLowAudioThresholdUsecs * mPlaybackRate ||
AudioQueue().IsFinished());
}
@ -1817,18 +1817,6 @@ MediaDecoderStateMachine::StartMediaSink()
}
}
int64_t MediaDecoderStateMachine::AudioDecodedUsecs()
{
MOZ_ASSERT(OnTaskQueue());
NS_ASSERTION(HasAudio(),
"Should only call AudioDecodedUsecs() when we have audio");
// The amount of audio we have decoded is the amount of audio data we've
// already decoded and pushed to the hardware, plus the amount of audio
// data waiting to be pushed to the hardware.
int64_t pushed = mMediaSink->IsStarted() ? (AudioEndTime() - GetMediaTime()) : 0;
return pushed + AudioQueue().Duration();
}
bool MediaDecoderStateMachine::HasLowDecodedData(int64_t aAudioUsecs)
{
MOZ_ASSERT(OnTaskQueue());
@ -1837,7 +1825,7 @@ bool MediaDecoderStateMachine::HasLowDecodedData(int64_t aAudioUsecs)
// provided we've not decoded to the end of the audio stream, or
// if we're low on video frames, provided
// we've not decoded to the end of the video stream.
return ((IsAudioDecoding() && AudioDecodedUsecs() < aAudioUsecs) ||
return ((IsAudioDecoding() && GetDecodedAudioDuration() < aAudioUsecs) ||
(IsVideoDecoding() &&
static_cast<uint32_t>(VideoQueue().GetSize()) < LOW_VIDEO_FRAMES));
}

View File

@ -448,12 +448,6 @@ protected:
// Returns true if we have less than aUsecs of undecoded data available.
bool HasLowUndecodedData(int64_t aUsecs);
// Returns the number of unplayed usecs of audio we've got decoded and/or
// pushed to the hardware waiting to play. This is how much audio we can
// play without having to run the audio decoder. The decoder monitor
// must be held.
int64_t AudioDecodedUsecs();
// Returns true when there's decoded audio waiting to play.
// The decoder monitor must be held.
bool HasFutureAudio();