Bug 1439529 - Same resolution is also feasible. r=jib a=lizzard
authorAndreas Pehrson <pehrsons@mozilla.com>
Mon, 26 Feb 2018 11:07:53 +0100
changeset 452616 4742bec115147335324b5c81827621233307ae1b
parent 452615 9d4192f91c6071dc160db49963c27505601ef738
child 452617 4ebc3f8a7357f68c706ef8224c6ed91697bc22d5
push id8792
push usercsabou@mozilla.com
push dateThu, 01 Mar 2018 02:26:08 +0000
treeherdermozilla-beta@f83587c150ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib, lizzard
bugs1439529
milestone59.0
Bug 1439529 - Same resolution is also feasible. r=jib a=lizzard 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;
 }