Bug 1357279 - Make sure mRustTestMode is inside #ifndef RELEASE_OR_BETA - r=alfredo

mRustTestMode is only declared when not in RELEASE_OR_BETA, so we must guard
all its uses.

The one in GetTrackInfo was a mistake, it shouldn't have been used there, as
we always want to compare results (without crashing) and report differences as
a warning.

The other ones just need the `#ifndef RELEASE_OR_BETA` guard.

MozReview-Commit-ID: LE31viVyhov

--HG--
extra : rebase_source : 5aed13d02c3a1ef27627bbf687d9aef05dcbf8ac
This commit is contained in:
Gerald Squelart 2017-04-18 15:15:30 +12:00
Родитель c05723ef0c
Коммит f831fb83b9
1 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -496,7 +496,7 @@ MP4Metadata::GetTrackInfo(mozilla::TrackInfo::TrackType aType,
}
#endif
if (mRustTestMode && info.Ref() && infoRust.Ref()) {
if (info.Ref() && infoRust.Ref()) {
const char* diff = GetDifferentField(*info.Ref(), *infoRust.Ref());
if (diff) {
return {MediaResult(NS_ERROR_DOM_MEDIA_METADATA_ERR,
@ -556,7 +556,11 @@ MP4Metadata::ResultAndIndice
MP4Metadata::GetTrackIndice(mozilla::TrackID aTrackID)
{
FallibleTArray<Index::Indice> indiceSF;
if (!mPreferRust || mRustTestMode) {
if (!mPreferRust
#ifndef RELEASE_OR_BETA
|| mRustTestMode
#endif
) {
MediaResult rv = mStagefright->ReadTrackIndex(indiceSF, aTrackID);
if (NS_FAILED(rv)) {
return {Move(rv), nullptr};
@ -564,7 +568,11 @@ MP4Metadata::GetTrackIndice(mozilla::TrackID aTrackID)
}
mp4parse_byte_data indiceRust = {};
if (mPreferRust || mRustTestMode) {
if (mPreferRust
#ifndef RELEASE_OR_BETA
|| mRustTestMode
#endif
) {
MediaResult rvRust = mRust->ReadTrackIndice(&indiceRust, aTrackID);
if (NS_FAILED(rvRust)) {
return {Move(rvRust), nullptr};