Bug 1350178 - Get stagefright indices only when rust parser is off or TestMode is on for saving memory usage. r=kinetik draft
authorAlfredo.Yang <ayang@mozilla.com>
Thu, 23 Mar 2017 14:23:36 +0800
changeset 504351 9877c569539a542de2caee1f724cb239d09c70f2
parent 504149 01d1dedf400d4be413b1a0d48090dca7acf29637
child 550639 e779170219c2b6f8f9f7d2ca851cfeb8236960a3
push id50786
push userbmo:ayang@mozilla.com
push dateFri, 24 Mar 2017 06:47:16 +0000
reviewerskinetik
bugs1350178
milestone55.0a1
Bug 1350178 - Get stagefright indices only when rust parser is off or TestMode is on for saving memory usage. r=kinetik MozReview-Commit-ID: F9P9O8YHJWg
media/libstagefright/binding/MP4Metadata.cpp
--- a/media/libstagefright/binding/MP4Metadata.cpp
+++ b/media/libstagefright/binding/MP4Metadata.cpp
@@ -417,17 +417,18 @@ MP4Metadata::Crypto() const
 
   return crypto;
 }
 
 mozilla::UniquePtr<IndiceWrapper>
 MP4Metadata::GetTrackIndice(mozilla::TrackID aTrackID)
 {
   FallibleTArray<Index::Indice> indiceSF;
-  if(!mStagefright->ReadTrackIndex(indiceSF, aTrackID)) {
+  if ((!mPreferRust || mRustTestMode) &&
+       !mStagefright->ReadTrackIndex(indiceSF, aTrackID)) {
     return nullptr;
   }
 
   mp4parse_byte_data indiceRust = {};
   if ((mPreferRust || mRustTestMode) &&
       !mRust->ReadTrackIndice(&indiceRust, aTrackID)) {
     return nullptr;
   }