From fe111a099d9706b16ae4608726ea0dde7261b269 Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Mon, 14 Nov 2022 11:57:54 +0900 Subject: [PATCH] Fix errors which are created by solving merge conflict - Issue: Some changes from previous commits are disappeared. - Solution: This patch rollbacks the some codes that disappeares by solving merge conflict. And also this patch fixes bug that are not return error. Change-Id: I81968cfa7cedc84aeb6d28e0f041cfe45d7190d1 Signed-off-by: Suyeon Hwang --- client/vc_mgr.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/client/vc_mgr.c b/client/vc_mgr.c index e974664..72f264b 100644 --- a/client/vc_mgr.c +++ b/client/vc_mgr.c @@ -750,7 +750,7 @@ int vc_mgr_set_demandable_client_rule(const char* rule) SLOG(LOG_DEBUG, TAG_VCM, "@@@ [Manager] Set Demandable client rule(%s) DONE", rule); - return VC_ERROR_NONE; + return ret; } int vc_mgr_unset_demandable_client_rule(void) @@ -1797,7 +1797,7 @@ int __vc_mgr_set_volume(float volume) { // called by app directly vc_mgr_core_set_volume(volume); - + return VC_ERROR_NONE; } @@ -2645,7 +2645,13 @@ static void __tts_feedback_thread(void* data, Ecore_Thread* thread) /* waiting */ while (1) { + if (ecore_thread_check(thread) == EINA_TRUE) { + SLOG(LOG_INFO, TAG_VCM, "[INFO] Stop feedback is called"); + return; + } + usleep(10000); + if (0 < vc_mgr_data_get_feedback_data_size()) { SLOG(LOG_INFO, TAG_VCM, "[INFO] Resume thread"); break; @@ -2685,16 +2691,6 @@ static void __tts_feedback_thread(void* data, Ecore_Thread* thread) vc_mgr_client_not_use_callback(); pthread_mutex_unlock(&g_feedback_streaming_cb_mutex); - - /* If no feedback data and EVENT_FINISH */ - if (0 >= vc_mgr_data_get_feedback_data_size() && VC_FEEDBACK_EVENT_FINISH == feedback_data->event) { - SLOG(LOG_INFO, TAG_VCM, "[INFO] Finish feedback"); - if (feedback_data) { - free(feedback_data); - feedback_data = NULL; - } - break; - } } else { vc_mgr_vc_tts_streaming_cb callback = NULL; void* user_data = NULL; @@ -2715,16 +2711,6 @@ static void __tts_feedback_thread(void* data, Ecore_Thread* thread) vc_mgr_client_not_use_callback(); pthread_mutex_unlock(&g_vc_tts_streaming_cb_mutex); - - /* If no feedback data and EVENT_FINISH */ - if (0 >= vc_mgr_data_get_feedback_data_size() && VC_FEEDBACK_EVENT_FINISH == feedback_data->event) { - SLOG(LOG_INFO, TAG_VCM, "[INFO] Finish vc tts feedback"); - if (feedback_data) { - free(feedback_data); - feedback_data = NULL; - } - break; - } } free(feedback_data); feedback_data = NULL; @@ -2802,8 +2788,12 @@ int vc_mgr_stop_feedback(void) RETVM_IF(VC_STATE_READY != state, VC_ERROR_INVALID_STATE, TAG_VCM, "[ERROR] Stop feedback : Current state is not 'Ready' (%d)", state); #if 1 - ret = -1; + if (g_feedback_thread) { + ecore_thread_cancel(g_feedback_thread); + g_feedback_thread = NULL; + } + ret = -1; while (1) { vc_feedback_data_s* feedback_data = NULL; @@ -3126,4 +3116,4 @@ int vc_mgr_reset_background_volume(void) SLOG(LOG_INFO, TAG_VCM, "[DEBUG] Success to recover volume"); return ret; -} \ No newline at end of file +} -- 2.7.4