Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
Fix determineClosestSupportedResolution
Browse files Browse the repository at this point in the history
The formula used to find the nearest resolution is a bit broken. Port of:
fyhertz/pull/87/commits/5334d8209777cd42407a7960664db7119694a795
  • Loading branch information
DragoonAethis committed Dec 11, 2018
1 parent 899ccfe commit 631a00a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static VideoQuality determineClosestSupportedResolution(Camera.Parameters
for (Iterator<Size> it = supportedSizes.iterator(); it.hasNext();) {
Size size = it.next();
supportedSizesStr += size.width+"x"+size.height+(it.hasNext()?", ":"");
int dist = Math.abs(quality.resX - size.width);
int dist = Math.abs(quality.resX - size.width) + Math.abs(quality.resY - size.height);
if (dist<minDist) {
minDist = dist;
v.resX = size.width;
Expand Down

0 comments on commit 631a00a

Please sign in to comment.