From: wn.jang Date: Thu, 26 Dec 2019 10:31:57 +0000 (+0900) Subject: change codes to function such as ttsd_player_clear X-Git-Tag: accepted/tizen/unified/20200113.130603~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Ftts.git;a=commitdiff_plain;h=66e25a1ba6b92c4729acc5672407c41eaf74cd19 change codes to function such as ttsd_player_clear Change-Id: I7de5c91a82970b0113c3e543f61b81ed787e2f5c --- diff --git a/server/ttsd_player.c b/server/ttsd_player.c index a59fe2a..c96ed44 100644 --- a/server/ttsd_player.c +++ b/server/ttsd_player.c @@ -1172,17 +1172,10 @@ int ttsd_player_play(int uid) int ttsd_player_stop(int uid) { - if (false == g_player_init) { - SLOG(LOG_ERROR, tts_tag(), "[Player ERROR] Not Initialized"); - return -1; - } - - /* Check uid */ - player_s* current; - current = __player_get_item(uid); - if (NULL == current) { - SLOG(LOG_ERROR, tts_tag(), "[Player ERROR] uid(%d) is not valid", uid); - return -1; + int ret = ttsd_player_clear(uid); + if (0 != ret) { + SLOG(LOG_ERROR, tts_tag(), "[Player ERROR] Fail to stop player, ret(%d)", ret); + return ret; } /* check whether uid is current playing or not */ @@ -1195,23 +1188,6 @@ int ttsd_player_stop(int uid) SLOG(LOG_DEBUG, tts_tag(), "[Player] No current playing"); } - if (true == current->is_paused_data) { - if (NULL != current->paused_data) { - if (NULL != current->paused_data->data) { - free(current->paused_data->data); - current->paused_data->data = NULL; - } - - free(current->paused_data); - current->paused_data = NULL; - } - } - - current->event = TTSE_RESULT_EVENT_FINISH; - current->state = APP_STATE_READY; - current->is_paused_data = false; - current->idx = 0; - if (NULL == g_playing_info) { SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@"); SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());