From: Jeongmo Yang Date: Mon, 10 Feb 2025 11:46:32 +0000 (+0900) Subject: Bug fix: Reset buffer size when start X-Git-Tag: accepted/tizen/unified/20250610.081745~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c917e1c9120f20c766b85559079a784a81fb3a1;p=platform%2Fhal%2Fbackend%2Fcodec-v4l2.git Bug fix: Reset buffer size when start - The buffer size will be increased while playing DRC contents, it causes segmentation fault when stop codec. Signed-off-by: Jeongmo Yang --- diff --git a/src/hal_backend_codec_v4l2.c b/src/hal_backend_codec_v4l2.c index 2a01889..9e23454 100644 --- a/src/hal_backend_codec_v4l2.c +++ b/src/hal_backend_codec_v4l2.c @@ -647,6 +647,7 @@ static int __codec_v4l2_s_fmt(codec_hal_buffer_control_s *buffer_control, int de } if (V4L2_TYPE_IS_MULTIPLANAR(codec_config->buf_type)) { + codec_config->buffer_size = 0; for (i = 0 ; i < v4l2_fmt.fmt.pix_mp.num_planes ; i++) { LOGI("[%s] plane[%d] size [%u]", BUFFER_CONTROL_TYPE_STRING(type), i, v4l2_fmt.fmt.pix_mp.plane_fmt[i].sizeimage); @@ -1968,7 +1969,7 @@ int codec_v4l2_start(void *codec_handle, hal_codec_message_cb callback, void *us handle->state = HAL_CODEC_STATE_STARTED; - LOGI("[type:%d] done", handle->type); + LOGI("[type:%d] done, buffer thread[%p]", handle->type, handle->buffer_handler); return HAL_CODEC_ERROR_NONE; } @@ -2003,7 +2004,7 @@ int codec_v4l2_stop(void *codec_handle) goto _STOP_DONE; } - LOGI("join buffer thread"); + LOGI("join buffer thread[%p]", handle->buffer_handler); if (handle->buffer_handler) { g_mutex_lock(&handle->buffer_control[CODEC_HAL_BUFFER_CONTROL_TYPE_OUTPUT].lock);