Bug 1340446 - check the rounding error smaller or euqal to one. r=kinetik
☠☠ backed out by cbf216f00dba ☠ ☠
authorAlfredo.Yang <ayang@mozilla.com>
Wed, 22 Feb 2017 11:38:16 +0800
changeset 344351 437ff32b12ea5c24126539dd649e9ad28817b4f4
parent 344350 c2c5efc2b57562d6d1b6c960a89efdfadd52e507
child 344352 34202e15401144849de180fa3f290e1ad0da4195
push id31407
push usercbook@mozilla.com
push dateThu, 23 Feb 2017 13:58:01 +0000
treeherdermozilla-central@27dade5e0c83 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs1340446
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1340446 - check the rounding error smaller or euqal to one. r=kinetik MozReview-Commit-ID: 4JvuY1yHGRk
media/libstagefright/binding/MP4Metadata.cpp
--- a/media/libstagefright/binding/MP4Metadata.cpp
+++ b/media/libstagefright/binding/MP4Metadata.cpp
@@ -369,19 +369,19 @@ MP4Metadata::ReadTrackIndex(FallibleTArr
   if (mRustTestMode && ret && mRust) {
     mp4parse_byte_data data = {};
     bool rustRet = mRust->ReadTrackIndice(&data, aTrackID);
     MOZ_DIAGNOSTIC_ASSERT(rustRet);
     MOZ_DIAGNOSTIC_ASSERT(data.length == aDest.Length());
     for (uint32_t i = 0; i < data.length; i++) {
       MOZ_DIAGNOSTIC_ASSERT(data.indices[i].start_offset == aDest[i].start_offset);
       MOZ_DIAGNOSTIC_ASSERT(data.indices[i].end_offset == aDest[i].end_offset);
-      MOZ_DIAGNOSTIC_ASSERT(data.indices[i].start_composition == aDest[i].start_composition);
-      MOZ_DIAGNOSTIC_ASSERT(data.indices[i].end_composition == aDest[i].end_composition);
-      MOZ_DIAGNOSTIC_ASSERT(data.indices[i].start_decode == aDest[i].start_decode);
+      MOZ_DIAGNOSTIC_ASSERT(abs(data.indices[i].start_composition - aDest[i].start_composition) <= 1);
+      MOZ_DIAGNOSTIC_ASSERT(abs(data.indices[i].end_composition - aDest[i].end_composition) <= 1);
+      MOZ_DIAGNOSTIC_ASSERT(abs(data.indices[i].start_decode - aDest[i].start_decode) <= 1);
       MOZ_DIAGNOSTIC_ASSERT(data.indices[i].sync == aDest[i].sync);
     }
   }
 #endif
 
   return ret;
 }