return TTSD_ERROR_NONE;
}
-static int __pause_client(unsigned int uid)
-{
- int ret = ttsd_data_set_client_state(uid, APP_STATE_PAUSED);
- if (TTSD_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail set pause state() : ret(%d)", ret);
- return TTSD_ERROR_OPERATION_FAILED;
- }
-
- ret = ttsd_player_pause(uid);
- if (TTSD_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail player_pause() : ret(%d)", ret);
- return TTSD_ERROR_OPERATION_FAILED;
- }
-
- return TTSD_ERROR_NONE;
-}
-
void __send_interrupt_client(unsigned int uid)
{
SLOG(LOG_INFO, tts_tag(), "[Server] Send new state by policy. uid(%u)", uid);
SLOG(LOG_DEBUG, tts_tag(), "[Server] Old uid(%u) will be interrupted into 'Pause' state ", current_uid);
/* pause player */
- if (0 != __pause_client(current_uid)) {
+ if (0 != ttsd_server_pause(current_uid)) {
SLOG(LOG_WARN, tts_tag(), "[Server ERROR] Fail to ttsd_server_pause() : uid (%u)", current_uid);
}
}
return TTSD_ERROR_NONE;
}
-int ttsd_server_pause(unsigned int uid, int* utt_id)
+int ttsd_server_pause(unsigned int uid)
{
app_tts_state_e state = ttsd_data_get_client_state(uid);
if (APP_STATE_NONE == state) {
return TTSD_ERROR_INVALID_STATE;
}
- g_is_paused = true;
-
- *utt_id = g_utt.uttid;
- SLOG(LOG_INFO, tts_tag(), "[Server] server pause, uid(%u), g_uid(%u), utt_id(%d)", uid, g_utt.uid, *utt_id);
+ int ret = ttsd_data_set_client_state(uid, APP_STATE_PAUSED);
+ if (TTSD_ERROR_NONE != ret) {
+ SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail set pause state() : ret(%d)", ret);
+ return TTSD_ERROR_OPERATION_FAILED;
+ }
- int ret = __pause_client(uid);
+ ret = ttsd_player_pause(uid);
if (TTSD_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to pause player : ret(%d)", ret);
+ SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail player_pause() : ret(%d)", ret);
return TTSD_ERROR_OPERATION_FAILED;
}
+ g_is_paused = true;
+
return TTSD_ERROR_NONE;
}
SLOG(LOG_DEBUG, tts_tag(), "[Server] Old uid(%u) will be interrupted into 'Pause' state ", current_uid);
/* pause player */
- if (0 != __pause_client(current_uid)) {
+ if (0 != ttsd_server_pause(current_uid)) {
SLOG(LOG_WARN, tts_tag(), "[Server ERROR] Fail to ttsd_server_pause() : uid (%u)", current_uid);
}
}
static int __pause_cb(rpc_port_stub_tts_context_h context, int uid, void *user_data)
{
- int uttid;
unsigned int u_uid = (unsigned int)uid;
SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS PLAYER PAUSE (%u)", u_uid);
- int ret = ttsd_server_pause(u_uid, &uttid);
+ int ret = ttsd_server_pause(u_uid);
if (TTSD_ERROR_NONE != ret) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS PLAYER PAUSE (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
return ret;