зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1524500 - P2. Simplify logic to break loop early. r=bryce
The logic was redundant with the next step that will already remove all until the next keyframe. Depends on D18321 Differential Revision: https://phabricator.services.mozilla.com/D18322 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
8701ff5245
Коммит
864ca81cfc
|
@ -2023,7 +2023,6 @@ uint32_t TrackBuffersManager::RemoveFrames(const TimeIntervals& aIntervals,
|
|||
// timestamp greater than or equal to highest end timestamp and less than
|
||||
// frame end timestamp"
|
||||
TimeUnit intervalsEnd = aIntervals.GetEnd();
|
||||
bool mayBreakLoop = false;
|
||||
for (uint32_t i = aStartIndex; i < data.Length(); i++) {
|
||||
const RefPtr<MediaRawData> sample = data[i];
|
||||
if (aIntervals.ContainsWithStrictEnd(sample->mTime)) {
|
||||
|
@ -2031,15 +2030,13 @@ uint32_t TrackBuffersManager::RemoveFrames(const TimeIntervals& aIntervals,
|
|||
firstRemovedIndex = Some(i);
|
||||
}
|
||||
lastRemovedIndex = i;
|
||||
mayBreakLoop = false;
|
||||
continue;
|
||||
}
|
||||
if (sample->mKeyframe && mayBreakLoop) {
|
||||
if (sample->mTime >= intervalsEnd) {
|
||||
// We can break the loop now. All frames up to the next keyframe will be
|
||||
// removed during the next step.
|
||||
break;
|
||||
}
|
||||
if (sample->mTime > intervalsEnd) {
|
||||
mayBreakLoop = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (firstRemovedIndex.isNothing()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче