Change-Id: I74d5c8fda0f24b158d172cf21957d492890bb8c2
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
static sound_stream_info_h g_stream_info_h;
static int g_focus_watch_id;
static sound_stream_info_h g_stream_info_h;
static int g_focus_watch_id;
/*
* Internal Interfaces
*/
/*
* Internal Interfaces
*/
if (APP_STATE_PAUSED == player->state) {
/* Save data */
if (APP_STATE_PAUSED == player->state) {
/* Save data */
+ SLOG(LOG_DEBUG, tts_tag(), "[Player] player(%p)", player);
player->paused_data = sound_data;
player->is_paused_data = true;
player->idx = idx;
g_audio_state = AUDIO_STATE_READY;
player->paused_data = sound_data;
player->is_paused_data = true;
player->idx = idx;
g_audio_state = AUDIO_STATE_READY;
SLOG(LOG_INFO, tts_tag(), "[Player] Stop player thread by pause");
/* Request prepare */
SLOG(LOG_INFO, tts_tag(), "[Player] Stop player thread by pause");
/* Request prepare */
if (NULL != g_playing_info) {
if (uid == g_playing_info->uid) {
/* release current playing info */
if (NULL != g_playing_info) {
if (uid == g_playing_info->uid) {
/* release current playing info */
+ SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] release current playing info (%d)", uid);
g_playing_info = NULL;
} else {
/* error case */
}
}
g_playing_info = NULL;
} else {
/* error case */
}
}
+ SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] current player (%p), g_playing_info(%p)", current, g_playing_info);
+
current->state = APP_STATE_PAUSED;
current->state = APP_STATE_PAUSED;
- SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
- SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());
- SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
+ 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());
+ SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
- /* The thread should be released */
- int thread_count = ecore_thread_active_get();
- int count = 0;
- while (0 < thread_count) {
- usleep(10000);
+ /* The thread should be released */
+ int thread_count = ecore_thread_active_get();
+ int count = 0;
+ while (0 < thread_count) {
+ usleep(10000);
- count++;
- if (30 == count) {
- SLOG(LOG_WARN, tts_tag(), "[Player WARNING!!] Thread is blocked. Player release continue.");
- break;
+ count++;
+ SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] current(%p), state(%d)", current, current->state);
+
+ if (30 == count) {
+ SLOG(LOG_WARN, tts_tag(), "[Player WARNING!!] Thread is blocked. Player release continue. current(%p) current state(%d)", current, current->state);
+ break;
+ }
+
+ thread_count = ecore_thread_active_get();
- thread_count = ecore_thread_active_get();
+ SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
+ SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());
+ SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
- SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
- SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());
- SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
SLOG(LOG_DEBUG, tts_tag(), "[Player SUCCESS] Pause player : uid(%d)", uid);
SLOG(LOG_DEBUG, tts_tag(), "[Player SUCCESS] Pause player : uid(%d)", uid);
static GList *g_proc_list = NULL;
static GList *g_proc_list = NULL;
+static bool g_is_paused;
+
+
/* Function definitions */
static int __synthesis(int uid, const char* credential);
/* Function definitions */
static int __synthesis(int uid, const char* credential);
ttsd_set_synth_control(TTSD_SYNTHESIS_CONTROL_DONE);
}
ttsd_set_synth_control(TTSD_SYNTHESIS_CONTROL_DONE);
}
+ /* If the app state is paused, do not result to play */
+ if (true == g_is_paused) {
+ SLOG(LOG_DEBUG, tts_tag(), "[Server DEBUG] tts_pause is called. Do not request to play");
+ return TTSD_ERROR_NONE;
+ }
+
if (0 != ttsd_player_play(uid)) {
SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to play sound : uid(%d)", uid);
if (0 != ttsd_player_play(uid)) {
SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to play sound : uid(%d)", uid);
if (APP_STATE_PAUSED == state) {
SLOG(LOG_DEBUG, tts_tag(), "[Server] uid(%d) is 'Pause' state : resume player", uid);
if (APP_STATE_PAUSED == state) {
SLOG(LOG_DEBUG, tts_tag(), "[Server] uid(%d) is 'Pause' state : resume player", uid);
/* Resume player */
if (0 != ttsd_player_resume(uid)) {
SLOG(LOG_WARN, tts_tag(), "[Server WARNING] Fail to ttsd_player_resume()");
/* Resume player */
if (0 != ttsd_player_resume(uid)) {
SLOG(LOG_WARN, tts_tag(), "[Server WARNING] Fail to ttsd_player_resume()");
/* Reset all data */
ttsd_data_clear_data(uid);
/* Reset all data */
ttsd_data_clear_data(uid);
return TTSD_ERROR_NONE;
}
return TTSD_ERROR_NONE;
}
return TTSD_ERROR_INVALID_STATE;
}
return TTSD_ERROR_INVALID_STATE;
}
*utt_id = g_utt.uttid;
SLOG(LOG_INFO, tts_tag(), "[Server] server pause, uid(%d), g_uid(%d), utt_id(%d)", uid, g_utt.uid, *utt_id);
*utt_id = g_utt.uttid;
SLOG(LOG_INFO, tts_tag(), "[Server] server pause, uid(%d), g_uid(%d), utt_id(%d)", uid, g_utt.uid, *utt_id);