Bug 1128332: Part3. Re-attempt to decode from last failed position. r=mattwoodrow

--HG--
extra : rebase_source : e583e0255e21c32f5d35a97d17f4dec92e2ba10c
This commit is contained in:
Jean-Yves Avenard 2015-03-18 14:10:58 +11:00
Родитель 44a39a5316
Коммит c9bc9c96bd
1 изменённых файлов: 14 добавлений и 0 удалений

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

@ -243,6 +243,7 @@ MediaSourceReader::OnAudioNotDecoded(NotDecodedReason aReason)
// If End of stream. Force switching past this stream to another reader by
// switching to the end of the buffered range.
int64_t lastAudioTime = mLastAudioTime;
if (aReason == END_OF_STREAM && mAudioSourceDecoder) {
AdjustEndTime(&mLastAudioTime, mAudioSourceDecoder);
}
@ -268,6 +269,12 @@ MediaSourceReader::OnAudioNotDecoded(NotDecodedReason aReason)
}
CheckForWaitOrEndOfStream(MediaData::AUDIO_DATA, mLastAudioTime);
if (mLastAudioTime - lastAudioTime >= EOS_FUZZ_US) {
// No decoders are available to switch to. We will re-attempt from the last
// failing position.
mLastAudioTime = lastAudioTime;
}
}
nsRefPtr<MediaDecoderReader::VideoDataPromise>
@ -384,6 +391,7 @@ MediaSourceReader::OnVideoNotDecoded(NotDecodedReason aReason)
// if End of stream. Force switching past this stream to another reader by
// switching to the end of the buffered range.
int64_t lastVideoTime = mLastVideoTime;
if (aReason == END_OF_STREAM && mVideoSourceDecoder) {
AdjustEndTime(&mLastVideoTime, mVideoSourceDecoder);
}
@ -409,6 +417,12 @@ MediaSourceReader::OnVideoNotDecoded(NotDecodedReason aReason)
}
CheckForWaitOrEndOfStream(MediaData::VIDEO_DATA, mLastVideoTime);
if (mLastVideoTime - lastVideoTime >= EOS_FUZZ_US) {
// No decoders are available to switch to. We will re-attempt from the last
// failing position.
mLastVideoTime = lastVideoTime;
}
}
void