Fix an issue not to exit from __play_thread 87/239387/1
authorsooyeon.kim <sooyeon.kim@samsung.com>
Fri, 24 Jul 2020 09:11:51 +0000 (18:11 +0900)
committersooyeon.kim <sooyeon.kim@samsung.com>
Fri, 24 Jul 2020 09:11:51 +0000 (18:11 +0900)
Change-Id: I710a5be24c48c3518e7a6e7540297439b08d3d07
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
server/ttsd_server.c

index aaeb596..10e3c9f 100644 (file)
@@ -151,7 +151,7 @@ int ttsd_send_error(ttse_error_e error, const char* msg)
        ttsd_set_synth_control(TTSD_SYNTHESIS_CONTROL_EXPIRED);
 
        if (0 != ttsd_player_clear(uid))
-               SLOG(LOG_WARN, tts_tag(), "[Server] Fail to ttsd_player_stop()");
+               SLOG(LOG_WARN, tts_tag(), "[Server] Fail to ttsd_player_clear()");
 
        if (0 != ttsd_data_clear_data(uid))
                SLOG(LOG_WARN, tts_tag(), "[Server] Fail to ttsd_data_clear_data()");
@@ -759,7 +759,7 @@ int ttsd_server_finalize(int uid)
        }
 
        ttsd_server_stop(uid);
-       ttsd_player_stop(uid);
+       ttsd_player_clear(uid);
 
        ttsd_player_destroy_instance(uid);
 
@@ -949,10 +949,7 @@ int ttsd_server_play(int uid, const char* credential)
 
                        /* pause player */
                        if (0 != ttsd_server_stop(current_uid)) {
-                               SLOG(LOG_WARN, tts_tag(), "[Server ERROR] Fail to stop : uid (%d)", current_uid);
-                       }
-                       if (0 != ttsd_player_stop(current_uid)) {
-                               SLOG(LOG_WARN, tts_tag(), "[Server ERROR] Fail to player stop : uid (%d)", current_uid);
+                               SLOG(LOG_WARN, tts_tag(), "[Server ERROR] Fail to stop server and player : uid (%d)", current_uid);
                        }
 
                        intptr_t pcurrent_uid = (intptr_t)current_uid;
@@ -1026,11 +1023,12 @@ int ttsd_server_stop(int uid)
                        if (0 != ret)
                                SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to cancel synthesis : ret(%d)", ret);
                }
-
                ttsd_set_synth_control(TTSD_SYNTHESIS_CONTROL_EXPIRED);
 
-               if (0 != ttsd_player_clear(uid))
+               /* stop player */
+               if (0 != ttsd_player_stop(uid)) {
                        SLOG(LOG_WARN, tts_tag(), "[Server] Fail to ttsd_player_stop()");
+               }
 
                ttsd_data_set_client_state(uid, APP_STATE_READY);
        }
@@ -1207,10 +1205,7 @@ int ttsd_server_play_pcm(int uid)
 
                        /* pause player */
                        if (0 != ttsd_server_stop(current_uid)) {
-                               SLOG(LOG_WARN, tts_tag(), "[Server ERROR] Fail to stop : uid (%d)", current_uid);
-                       }
-                       if (0 != ttsd_player_stop(current_uid)) {
-                               SLOG(LOG_WARN, tts_tag(), "[Server ERROR] Fail to player stop : uid (%d)", current_uid);
+                               SLOG(LOG_WARN, tts_tag(), "[Server ERROR] Fail to stop server and player : uid (%d)", current_uid);
                        }
 
                        intptr_t pcurrent_uid = (intptr_t)current_uid;