summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2014-01-27 21:16:04 +0000
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2014-01-27 21:16:04 +0000
commitb5007ffc2decdfeacf02f722ff889f0b7ed3b68b (patch)
tree9b0b4f8888b5644881b2ab37daf66b26bfe50ffe
parent4e6c2d1fcf233ea4fc0b4d2198c8b22fff51db30 (diff)
downloaddevice_samsung_smdk4412-common-b5007ffc2decdfeacf02f722ff889f0b7ed3b68b.zip
device_samsung_smdk4412-common-b5007ffc2decdfeacf02f722ff889f0b7ed3b68b.tar.gz
device_samsung_smdk4412-common-b5007ffc2decdfeacf02f722ff889f0b7ed3b68b.tar.bz2
camera: Hold 25 msec between preview cycles on restart
If doing a preview restart with an active listener, give said listener a bit of time to clean up before starting up the preview again. This should be sufficient to prevent shutdown/start race conditions during externally triggered restarts. Change-Id: Id4a722c472eeffb50a332b0dabc29d9e23062883
-rw-r--r--camera/exynos_camera.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/camera/exynos_camera.c b/camera/exynos_camera.c
index f0cb0c3..9657eea 100644
--- a/camera/exynos_camera.c
+++ b/camera/exynos_camera.c
@@ -2636,6 +2636,8 @@ void *exynos_camera_preview_thread(void *data)
}
if (exynos_camera->preview_listener->busy) {
+ // Prevent preview restart race conditions
+ usleep((useconds_t)25 * 1000);
rc = exynos_camera_preview(exynos_camera);
if (rc < 0) {
ALOGE("%s: Unable to preview", __func__);