Bug 1304820 - use stagefright instead of rust parser when it fails to parse the file. r=kinetic draft
authorAlfredo.Yang <ayang@mozilla.com>
Fri, 23 Sep 2016 14:37:07 +0800
changeset 416863 c8f559757d19d6fbeebdcef25901f32a375a64e1
parent 416562 f0e6cc6360213ba21fd98c887b55fce5c680df68
child 531972 af6b352754237363081d02285e9a00d98ecf9825
push id30272
push userbmo:ayang@mozilla.com
push dateFri, 23 Sep 2016 06:44:19 +0000
reviewerskinetic
bugs1304820
milestone52.0a1
Bug 1304820 - use stagefright instead of rust parser when it fails to parse the file. r=kinetic MozReview-Commit-ID: 3pi2LtDJhWE
media/libstagefright/binding/MP4Metadata.cpp
--- a/media/libstagefright/binding/MP4Metadata.cpp
+++ b/media/libstagefright/binding/MP4Metadata.cpp
@@ -335,19 +335,20 @@ MP4Metadata::Crypto() const
 {
   return mStagefright->Crypto();
 }
 
 bool
 MP4Metadata::ReadTrackIndex(FallibleTArray<Index::Indice>& aDest, mozilla::TrackID aTrackID)
 {
 #ifdef MOZ_RUST_MP4PARSE
-  if (mRust && mPreferRust) {
-    return mRust->ReadTrackIndex(aDest, aTrackID);
+  if (mRust && mPreferRust && mRust->ReadTrackIndex(aDest, aTrackID)) {
+    return true;
   }
+  aDest.Clear();
 #endif
   return mStagefright->ReadTrackIndex(aDest, aTrackID);
 }
 
 static inline bool
 ConvertIndex(FallibleTArray<Index::Indice>& aDest,
              const nsTArray<stagefright::MediaSource::Indice>& aIndex,
              int64_t aMediaTime)