Bug 1439529 - Same resolution is also feasible. r?jib
MozReview-Commit-ID: F9DGzgr7pCN
--- 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;
}