Bug 1304820 - use stagefright instead of rust parser when rust parser fails to parse a file. r=kinetik draft
authorAlfredo.Yang <ayang@mozilla.com>
Fri, 23 Sep 2016 14:37:07 +0800
changeset 416912 7bb71369eb969fd762d99079dbc7f174e1f0d75e
parent 416562 f0e6cc6360213ba21fd98c887b55fce5c680df68
child 531981 17be9fe64f47279087a740136d0079b1e2b4d439
push id30281
push userbmo:ayang@mozilla.com
push dateFri, 23 Sep 2016 07:17:58 +0000
reviewerskinetik
bugs1304820
milestone52.0a1
Bug 1304820 - use stagefright instead of rust parser when rust parser fails to parse a file. r=kinetik MozReview-Commit-ID: 8tjl9MICvWo
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)
@@ -834,17 +835,17 @@ MP4MetadataRust::ReadTrackIndex(Fallible
     return false;
   }
 
   if (fragmented) {
     return true;
   }
 
   // For non-fragmented mp4.
-  MOZ_ASSERT(false, "Not yet implemented");
+  NS_WARNING("Not yet implemented");
 
   return false;
 }
 
 /*static*/ bool
 MP4MetadataRust::HasCompleteMetadata(Stream* aSource)
 {
   MOZ_ASSERT(false, "Not yet implemented");