Skip to content

Commit

Permalink
Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuriy Budiyev committed Oct 3, 2017
1 parent b136d0a commit d366888
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ private void setAutoFocusEnabledInternal(boolean autoFocusEnabled) {
}
}

private void autoFocusCameraSafe() {
private void safeAutoFocusCamera() {
if (!mInitialized || !mPreviewActive) {
return;
}
Expand All @@ -476,7 +476,9 @@ private void autoFocusCameraSafe() {
mSafeAutoFocusAttemptsCount++;
} else {
try {
mDecoderWrapper.getCamera().autoFocus(mSafeAutoFocusCallback);
Camera camera = mDecoderWrapper.getCamera();
camera.cancelAutoFocus();
camera.autoFocus(mSafeAutoFocusCallback);
mSafeAutoFocusAttemptsCount = 0;
mSafeAutoFocusing = true;
} catch (Exception e) {
Expand Down Expand Up @@ -672,7 +674,7 @@ private final class SafeAutoFocusTask implements Runnable {
public void run() {
mSafeAutoFocusTaskScheduled = false;
if (mAutoFocusMode == AUTO_FOCUS_MODE_SAFE) {
autoFocusCameraSafe();
safeAutoFocusCamera();
}
}
}
Expand Down

0 comments on commit d366888

Please sign in to comment.