Bug 1229339: Partial revert of commit c15c9f37f. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 02 Dec 2015 00:09:05 +1100
changeset 274968 2b8b0a674775ec089cb831d979b43e9f0ff448e5
parent 274967 f71baaaa598da31010b6e6b52c3f9d448cd3ddcf
child 274969 571d6fc4fcdde4b0587bbf22e84e5e7141bbaebf
push id68741
push userjyavenard@mozilla.com
push dateTue, 01 Dec 2015 21:37:58 +0000
treeherdermozilla-inbound@2b8b0a674775 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1229339
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1229339: Partial revert of commit c15c9f37f. r=cpearce Replacement of nsTArray<MediaByteRange> by MediaByteRangeSet in the MoofParser was incorrect.
media/libstagefright/binding/MoofParser.cpp
media/libstagefright/binding/include/mp4_demuxer/MoofParser.h
--- a/media/libstagefright/binding/MoofParser.cpp
+++ b/media/libstagefright/binding/MoofParser.cpp
@@ -54,26 +54,26 @@ MoofParser::RebuildFragmentedIndex(BoxCo
 
       if (!mMoofs.IsEmpty()) {
         // Stitch time ranges together in the case of a (hopefully small) time
         // range gap between moofs.
         mMoofs.LastElement().FixRounding(moof);
       }
 
       mMoofs.AppendElement(moof);
-      mMediaRanges += moof.mRange;
+      mMediaRanges.AppendElement(moof.mRange);
       foundValidMoof = true;
     } else if (box.IsType("mdat") && !Moofs().IsEmpty()) {
       // Check if we have all our data from last moof.
       Moof& moof = Moofs().LastElement();
       media::Interval<int64_t> datarange(moof.mMdatRange.mStart, moof.mMdatRange.mEnd, 0);
       media::Interval<int64_t> mdat(box.Range().mStart, box.Range().mEnd, 0);
       if (datarange.Intersects(mdat)) {
-        mMediaRanges.LastInterval() =
-          mMediaRanges.LastInterval().Span(box.Range());
+        mMediaRanges.LastElement() =
+          mMediaRanges.LastElement().Span(box.Range());
       }
     }
     mOffset = box.NextOffset();
   }
   return foundValidMoof;
 }
 
 MediaByteRange
--- a/media/libstagefright/binding/include/mp4_demuxer/MoofParser.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/MoofParser.h
@@ -240,14 +240,14 @@ public:
   Tfdt mTfdt;
   Edts mEdts;
   Sinf mSinf;
   nsTArray<Moof>& Moofs() { return mMoofs; }
 private:
   void ScanForMetadata(mozilla::MediaByteRange& aFtyp,
                        mozilla::MediaByteRange& aMoov);
   nsTArray<Moof> mMoofs;
-  MediaByteRangeSet mMediaRanges;
+  nsTArray<MediaByteRange> mMediaRanges;
   bool mIsAudio;
 };
 }
 
 #endif