From: Jeongmo Yang Date: Mon, 28 Oct 2019 07:07:29 +0000 (+0900) Subject: Do not call DQBUF after stop_preview is called X-Git-Tag: submit/tizen_5.5/20191106.104919^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22d3598db7f74ef8c3bb8cadc37b7e4651728d2c;p=platform%2Fadaptation%2Fcamera-hal-v4l2.git Do not call DQBUF after stop_preview is called [Version] 0.0.10 [Profile] Common [Issue Type] Update Change-Id: I4ddc54a818b77cb6f4d4cec27eaa8bc03fe29e3c Signed-off-by: Jeongmo Yang --- diff --git a/packaging/camera-hal-v4l2.spec b/packaging/camera-hal-v4l2.spec index cc1a87f..d77166d 100644 --- a/packaging/camera-hal-v4l2.spec +++ b/packaging/camera-hal-v4l2.spec @@ -1,6 +1,6 @@ Name: camera-hal-v4l2 Summary: Tizen Camera Hal for V4L2 -Version: 0.0.9 +Version: 0.0.10 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/tizen_camera_v4l2.c b/src/tizen_camera_v4l2.c index 5996772..6454cd6 100644 --- a/src/tizen_camera_v4l2.c +++ b/src/tizen_camera_v4l2.c @@ -609,14 +609,18 @@ static void *_camera_preview_handler_func(gpointer data) break; } + g_mutex_lock(&handle->preview_cb_lock); + + if (handle->preview_cb_run == FALSE) { + LOGW("stop preview handler thread"); + break; + } + if (_camera_v4l2_dqbuf(handle->device_fd, handle->v4l2_type, V4L2_MEMORY_MMAP, &index) != CAMERA_ERROR_NONE) { LOGE("dqbuf failed"); - g_mutex_lock(&handle->preview_cb_lock); break; } - g_mutex_lock(&handle->preview_cb_lock); - handle->live_buffer_num++; LOGD("live buffer num %d", handle->live_buffer_num);