static GList *g_proc_list = NULL;
+static bool g_is_paused;
+
+
/* Function definitions */
static int __synthesis(int uid, const char* credential);
if (0 != ttsd_data_add_sound_data(uid, temp_sound_data)) {
SECURE_SLOG(LOG_ERROR, tts_tag(), "[SERVER ERROR] Fail to add sound data : uid(%d)", uid);
+ if (NULL != temp_sound_data->data) {
+ free(temp_sound_data->data);
+ temp_sound_data->data = NULL;
+ }
+
+ free(temp_sound_data);
+ temp_sound_data = NULL;
+
+ return TTSD_ERROR_OPERATION_FAILED;
}
if (event == TTSE_RESULT_EVENT_FINISH) {
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 (APP_STATE_PAUSED == state) {
SLOG(LOG_DEBUG, tts_tag(), "[Server] uid(%d) is 'Pause' state : resume player", uid);
+ g_is_paused = false;
+
/* 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);
+ g_is_paused = false;
return TTSD_ERROR_NONE;
}
return TTSD_ERROR_INVALID_STATE;
}
+ g_is_paused = true;
+
*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);