Bug 1531201 - Don't assume all frames' time is greater than 0. r=gerald

We now allow frames to have a negative time (so that they can be decoded and trimmed).

Differential Revision: https://phabricator.services.mozilla.com/D21474

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2019-02-28 02:34:04 +00:00
Родитель 8c2602c9e5
Коммит fc260afed4
1 изменённых файлов: 6 добавлений и 3 удалений

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

@ -521,9 +521,12 @@ void TrackBuffersManager::DoEvictData(const TimeUnit& aPlaybackTime,
if (lastKeyFrameIndex > 0) {
MSE_DEBUG("Step1. Evicting %" PRId64 " bytes prior currentTime",
aSizeToEvict - toEvict);
CodedFrameRemoval(TimeInterval(
TimeUnit::Zero(),
buffer[lastKeyFrameIndex]->mTime - TimeUnit::FromMicroseconds(1)));
TimeUnit start = track.mBufferedRanges[0].mStart;
TimeUnit end =
buffer[lastKeyFrameIndex]->mTime - TimeUnit::FromMicroseconds(1);
if (end > start) {
CodedFrameRemoval(TimeInterval(start, end));
}
}
if (mSizeSourceBuffer <= finalSize) {