Fix to avoid paused_data crash 60/239360/1
authorsooyeon.kim <sooyeon.kim@samsung.com>
Fri, 24 Jul 2020 07:13:56 +0000 (16:13 +0900)
committersooyeon.kim <sooyeon.kim@samsung.com>
Fri, 24 Jul 2020 07:13:56 +0000 (16:13 +0900)
Change-Id: Ia0db6b669f802ae01adfbe6e4379430ebf985104
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
server/ttsd_player.c

index 5ae0f1d..e4faaa8 100644 (file)
@@ -537,6 +537,14 @@ static void __play_thread(void *data, Ecore_Thread *thread)
        /* set volume policy as 40% */
        __set_policy_for_playing(40);
        while (1) {
+               /* check g_playing_info one more time */
+               if (NULL == g_playing_info) {
+                       SLOG(LOG_INFO, tts_tag(), "[Player INFO] No current player");
+                       g_audio_state = AUDIO_STATE_READY;
+                       __unset_policy_for_playing();
+                       return;
+               }
+
                if (true == player->is_paused_data) {
                        /* Resume player */
                        if (NULL != sound_data) {
@@ -1241,10 +1249,10 @@ int ttsd_player_stop(int uid)
                int thread_count = ecore_thread_active_get();
                int count = 0;
                while (0 < thread_count) {
-                       usleep(10000);
+                       usleep(20000);
 
                        count++;
-                       if (30 == count) {
+                       if (50 == count) {
                                SLOG(LOG_WARN, tts_tag(), "[Player WARNING!!] Thread is blocked. Player release continue.");
                                break;
                        }