Bug 1276184: [MSE] P3. Be consistent with types when accessing track buffer. r?kamidphish draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 02 Jun 2016 17:14:03 +1000
changeset 374301 2c17aa4cf282
parent 374300 7d06e4ec7a1c
child 374918 e71735d3cfee
push id19986
push userbmo:jyavenard@mozilla.com
push dateThu, 02 Jun 2016 07:36:36 +0000
reviewerskamidphish
bugs1276184
milestone49.0a1
Bug 1276184: [MSE] P3. Be consistent with types when accessing track buffer. r?kamidphish MozReview-Commit-ID: BJlNeValVxE
dom/media/mediasource/TrackBuffersManager.cpp
--- 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();