Bug 1276184: [MSE] P3. Be consistent with types when accessing track buffer. r?kamidphish
MozReview-Commit-ID: BJlNeValVxE
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -1685,17 +1685,17 @@ TrackBuffersManager::RemoveFrames(const
// 14 of the coded frame processing algorithm without having to check the value
// of highest end timestamp:
// "Remove existing coded frames in track buffer:
// If highest end timestamp for track buffer is not set:
// Remove all coded frames from track buffer that have a presentation timestamp greater than or equal to presentation timestamp and less than frame end timestamp.
// If highest end timestamp for track buffer is set and less than or equal to presentation timestamp:
// Remove all coded frames from track buffer that have a presentation timestamp greater than or equal to highest end timestamp and less than frame end timestamp"
for (uint32_t i = aStartIndex; i < data.Length(); i++) {
- MediaRawData* sample = data[i].get();
+ const RefPtr<MediaRawData> sample = data[i];
TimeInterval sampleInterval =
TimeInterval(TimeUnit::FromMicroseconds(sample->mTime),
TimeUnit::FromMicroseconds(sample->GetEndTime()));
if (aIntervals.Contains(sampleInterval)) {
if (firstRemovedIndex.isNothing()) {
firstRemovedIndex = Some(i);
}
lastRemovedIndex = i;
@@ -1704,27 +1704,27 @@ TrackBuffersManager::RemoveFrames(const
if (firstRemovedIndex.isNothing()) {
return 0;
}
// Remove decoding dependencies of the coded frames removed in the previous step:
// Remove all coded frames between the coded frames removed in the previous step and the next random access point after those removed frames.
for (uint32_t i = lastRemovedIndex + 1; i < data.Length(); i++) {
- MediaRawData* sample = data[i].get();
+ const RefPtr<MediaRawData>& sample = data[i];
if (sample->mKeyframe) {
break;
}
lastRemovedIndex = i;
}
int64_t maxSampleDuration = 0;
TimeIntervals removedIntervals;
for (uint32_t i = firstRemovedIndex.ref(); i <= lastRemovedIndex; i++) {
- MediaRawData* sample = data[i].get();
+ const RefPtr<MediaRawData> sample = data[i];
TimeInterval sampleInterval =
TimeInterval(TimeUnit::FromMicroseconds(sample->mTime),
TimeUnit::FromMicroseconds(sample->GetEndTime()));
removedIntervals += sampleInterval;
if (sample->mDuration > maxSampleDuration) {
maxSampleDuration = sample->mDuration;
}
aTrackData.mSizeBuffer -= sample->ComputedSizeOfIncludingThis();