Merge "Fix config client type as a bit flat" into tizen_6.5
authorWonnam Jang <wn.jang@samsung.com>
Fri, 17 Dec 2021 07:40:48 +0000 (07:40 +0000)
committerGerrit Code Review <gerrit@review>
Fri, 17 Dec 2021 07:40:48 +0000 (07:40 +0000)
server/ttsd_data.cpp
server/ttsd_player.c
server/ttsd_server.c

index b31c580..2bf187a 100644 (file)
@@ -130,13 +130,13 @@ int __data_show_used_voice_list(app_data_s& app_data)
 
 int ttsd_set_synth_control(ttsd_synthesis_control_e control)
 {
+       SLOG(LOG_INFO, tts_tag(), "[DATA INFO] set synth_control(%d)", control);
        g_synth_control = control;
        return 0;
 }
 
 ttsd_synthesis_control_e ttsd_get_synth_control()
 {
-       SLOG(LOG_INFO, tts_tag(), "g_synth_control(%d)", g_synth_control.load());
        return g_synth_control.load();
 }
 
index d5ff1af..6309229 100644 (file)
@@ -666,7 +666,9 @@ static void __play_thread(void *data, Ecore_Thread *thread)
                                        }
 
                                        /* If engine is not on processing */
-                                       if (TTSD_SYNTHESIS_CONTROL_DOING != ttsd_get_synth_control()) {
+                                       ttsd_synthesis_control_e synth_control = ttsd_get_synth_control();
+                                       if (TTSD_SYNTHESIS_CONTROL_DOING != synth_control) {
+                                               SLOG(LOG_INFO, tts_tag(), "[Server INFO] synth_control(%d)", synth_control);
                                                if (AUDIO_STATE_PLAY == g_audio_state) {
                                                        /* release audio & recover session */
                                                        ret = audio_out_unprepare(g_audio_h);
index c13273b..d489d7b 100644 (file)
@@ -70,11 +70,13 @@ static Eina_Bool __wait_synthesis(void *data)
        int uid = ttsd_data_get_current_playing();
 
        if (uid > 0) {
-               if (TTSD_SYNTHESIS_CONTROL_DOING == ttsd_get_synth_control()) {
+               ttsd_synthesis_control_e synth_control = ttsd_get_synth_control();
+               if (TTSD_SYNTHESIS_CONTROL_DOING == synth_control) {
                        return EINA_TRUE;
                } else {
+                       SLOG(LOG_INFO, tts_tag(), "[Server] synth_control(%d)", synth_control);
                        g_wait_timer = NULL;
-                       if (TTSD_SYNTHESIS_CONTROL_DONE == ttsd_get_synth_control()) {
+                       if (TTSD_SYNTHESIS_CONTROL_DONE == synth_control) {
                                /* Start next synthesis */
                                __synthesis(uid, credential);
                        }
@@ -943,7 +945,9 @@ int ttsd_server_add_queue(int uid, const char* text, const char* lang, int voice
                }
 
                /* Check whether tts-engine is running or not */
-               if (TTSD_SYNTHESIS_CONTROL_DOING == ttsd_get_synth_control()) {
+               ttsd_synthesis_control_e synth_control = ttsd_get_synth_control();
+               SLOG(LOG_INFO, tts_tag(), "[Server INFO] synth_control(%d)", synth_control);
+               if (TTSD_SYNTHESIS_CONTROL_DOING == synth_control) {
                        SLOG(LOG_WARN, tts_tag(), "[Server WARNING] Engine has already been running.");
                } else {
                        __synthesis(uid, credential);
@@ -1066,7 +1070,9 @@ int ttsd_server_play(int uid, const char* credential)
 
        /* Check whether tts-engine is running or not */
        clock_gettime(CLOCK_MONOTONIC_RAW, &g_request_playing);
-       if (TTSD_SYNTHESIS_CONTROL_DOING == ttsd_get_synth_control()) {
+       ttsd_synthesis_control_e synth_control = ttsd_get_synth_control();
+       SLOG(LOG_INFO, tts_tag(), "[Server INFO] synth_control(%d)", synth_control);
+       if (TTSD_SYNTHESIS_CONTROL_DOING == synth_control) {
                SLOG(LOG_WARN, tts_tag(), "[Server WARNING] Engine has already been running.");
        } else {
                __synthesis(uid, credential);
@@ -1083,10 +1089,12 @@ int ttsd_server_stop(int uid)
                return TTSD_ERROR_INVALID_PARAMETER;
        }
 
-       SLOG(LOG_INFO, tts_tag(), "[Server] server stop, state(%d)", state);
+       SLOG(LOG_INFO, tts_tag(), "[Server] server stop, uid(%d), state(%d)", uid, state);
 
        if (APP_STATE_PLAYING == state || APP_STATE_PAUSED == state) {
-               if (TTSD_SYNTHESIS_CONTROL_DOING == ttsd_get_synth_control() && uid == ttsd_data_get_current_playing()) {
+               ttsd_synthesis_control_e synth_control = ttsd_get_synth_control();
+               SLOG(LOG_INFO, tts_tag(), "[Server INFO] synth_control(%d)", synth_control);
+               if (TTSD_SYNTHESIS_CONTROL_DOING == synth_control && uid == ttsd_data_get_current_playing()) {
                        SLOG(LOG_DEBUG, tts_tag(), "[Server] TTS-engine is running");
 
                        int ret = 0;