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 */
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());