Bug 1439529 - Same resolution is also feasible. r=jib
authorAndreas Pehrson <pehrsons@mozilla.com>
Mon, 26 Feb 2018 11:07:53 +0100
changeset 405540 b419a3421162969af2c8b4370b5a420922d766b4
parent 405539 a71537bbb29a49b7e2db785ae0a0d0906ba0e657
child 405541 77d5fc984c508722b33280df5a7e6673c0dd5d00
push id60258
push userpehrsons@gmail.com
push dateTue, 27 Feb 2018 11:03:46 +0000
treeherderautoland@b419a3421162 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1439529
milestone60.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 1439529 - Same resolution is also feasible. r=jib MozReview-Commit-ID: F9DGzgr7pCN
dom/media/systemservices/CamerasParent.cpp
--- a/dom/media/systemservices/CamerasParent.cpp
+++ b/dom/media/systemservices/CamerasParent.cpp
@@ -55,19 +55,18 @@ ResolutionFeasibilityDistance(int32_t ca
   if (candidate == 0) {
     // Treat width|height capability of 0 as "can do any".
     // This allows for orthogonal capabilities that are not in discrete steps.
     return 0;
   }
 
   uint32_t distance =
     std::abs(candidate - requested) * 1000 / std::max(candidate, requested);
-  if (candidate > requested) {
-    // This is a good case, the candidate is higher than the requested
-    // resolution which makes it feasible.
+  if (candidate >= requested) {
+    // This is a good case, the candidate covers the requested resolution.
     return distance;
   }
 
   // This is a bad case, the candidate is lower than the requested resolution.
   // This is penalized with an added weight of 10000.
   return 10000 + distance;
 }