Bug 1439529 - Same resolution is also feasible. r?jib draft
authorAndreas Pehrson <pehrsons@mozilla.com>
Mon, 26 Feb 2018 11:07:53 +0100
changeset 760269 d6abea1cce397126b86f778c623a243819f2dd12
parent 754870 e293877d13a5236119adb706c97c55ea9e11868b
child 761165 e31fd1d347e1e4ca49c9bfdff2b0f8cadc414be3
child 762520 9785013d5574da8c322e0a2ffe484950ab2e8e16
push id100602
push userbmo:apehrson@mozilla.com
push dateTue, 27 Feb 2018 11:01:39 +0000
reviewersjib
bugs1439529
milestone60.0a1
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;
 }