Re-added Paolo's Android autofocus crash fix (see 633b5f7)

This commit is contained in:
TJ Woon 2015-02-27 18:56:31 +08:00
parent bc944fea99
commit ff4c716e46

View File

@ -238,7 +238,11 @@ implements SurfaceHolder.Callback {
private AutoFocusCallback autoFocusCb = new AutoFocusCallback()
{
public void onAutoFocus(boolean success, Camera camera) {
autoFocusHandler.postDelayed(doAutoFocus, autoFocusInterval);
// some devices crash without this try/catch and cancelAutoFocus()... (#9)
try {
camera.cancelAutoFocus();
autoFocusHandler.postDelayed(doAutoFocus, autoFocusInterval);
} catch (Exception e) {}
}
};