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
--- 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;
}