From a71f3c508dc67a058feac1dc00d0dcda3cbe8c91 Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Thu, 13 Jul 2023 15:11:11 +0900 Subject: [PATCH] Fix condition for checking return value of play_sound() - Issue: sttd_server_start() did not progress even though all behavior is properly worked. - Solution: play_start_sound_for_uid() return true if start sound is playing. However, previous code uses this return value reversely. So, the sttd_server_start() worked inproperly. To solve this issue, this patch fixes the condition properly. Through this patch, sttd_server_start() will work properly. Change-Id: Iba90d239b917182fbffea54cb526ebe5629262a7 Signed-off-by: Suyeon Hwang --- server/sttd_server.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/sttd_server.c b/server/sttd_server.c index b8a4adc..7f6f282 100644 --- a/server/sttd_server.c +++ b/server/sttd_server.c @@ -1198,7 +1198,7 @@ int sttd_server_start(unsigned int uid, const char* lang, const char* recognitio } /* 2. Request wav play */ - bool is_sound_done = play_start_sound_for_uid(uid); + bool is_playing = play_start_sound_for_uid(uid); /* 3. Create recorder & engine initialize */ ret = sttd_engine_agent_recognize_start_engine(uid, lang, recognition_type, silence, appid, credential, NULL); @@ -1219,10 +1219,7 @@ int sttd_server_start(unsigned int uid, const char* lang, const char* recognitio sttd_client_set_state(uid, APP_STATE_RECORDING); g_recording_log_count = 0; - - app_state_e temp_app_state; - - if (true == is_sound_done) { + if (false == is_playing) { SLOG(LOG_INFO, TAG_STTD, "[Server] No sound play"); ret = sttd_engine_agent_recognize_start_recorder(uid, appid); @@ -1241,6 +1238,7 @@ int sttd_server_start(unsigned int uid, const char* lang, const char* recognitio return ret; } + app_state_e temp_app_state; if (0 != sttd_client_get_state(uid, &temp_app_state)) { SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] uid is NOT valid"); return STTD_ERROR_INVALID_PARAMETER; -- 2.7.4