Bug 1185972: P4. Initiate seek as early as conditions permit. r=jwwang

We can initiate a seek as soon as we have a start time and metadata have been read.
However, only enable this feature for MSE as some tests expect events in a specific order.
This commit is contained in:
Jean-Yves Avenard 2015-07-25 18:42:41 +10:00
Родитель 797031e88a
Коммит c5999c60f3
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -1471,7 +1471,8 @@ MediaDecoderStateMachine::Seek(SeekTarget aTarget)
NS_ASSERTION(mState > DECODER_STATE_DECODING_METADATA,
"We should have got duration already");
if (mState < DECODER_STATE_DECODING || IsDecodingFirstFrame()) {
if (mState < DECODER_STATE_DECODING ||
(IsDecodingFirstFrame() && !mReader->ForceZeroStartTime())) {
DECODER_LOG("Seek() Not Enough Data to continue at this stage, queuing seek");
mQueuedSeek.RejectIfExists(__func__);
mQueuedSeek.mTarget = aTarget;
@ -2126,6 +2127,12 @@ MediaDecoderStateMachine::SeekCompleted()
}
mPlayDuration = newCurrentTime;
if (mDecodingFirstFrame) {
// We were resuming from dormant, or initiated a seek early.
// We can fire loadeddata now.
FinishDecodeFirstFrame();
}
// Change state to DECODING or COMPLETED now. SeekingStopped will
// call MediaDecoderStateMachine::Seek to reset our state to SEEKING
// if we need to seek again.