From: sooyeon Date: Wed, 20 Oct 2021 19:26:54 +0000 (+0900) Subject: Add a state checker to ignore invalid synthesized pcm X-Git-Tag: submit/tizen/20211028.101609~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d36395044b5f06f4c5bc16d70419df5bf666ef85;p=platform%2Fcore%2Fuifw%2Ftts.git Add a state checker to ignore invalid synthesized pcm Change-Id: Ib0282024e288cede7e557dd00ea5ee0b09f7fe90 Signed-off-by: sooyeon --- diff --git a/server/ttsd_server.c b/server/ttsd_server.c index cb83d416..8f01e230 100644 --- a/server/ttsd_server.c +++ b/server/ttsd_server.c @@ -219,6 +219,21 @@ int ttsd_send_result(ttse_result_event_e event, const void* data, unsigned int d return TTSD_ERROR_INVALID_PARAMETER; } + /* check the current state */ + app_tts_state_e state; + if (0 > ttsd_data_get_client_state(uid, &state)) { + ttsd_set_synth_control(TTSD_SYNTHESIS_CONTROL_DONE); + SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] uid is not valid"); + return TTSD_ERROR_INVALID_PARAMETER; + } + + SLOG(LOG_INFO, tts_tag(), "[Server] uid(%d), current state(%d)", uid, state); + if (APP_STATE_CREATED == state || APP_STATE_READY == state) { + ttsd_set_synth_control(TTSD_SYNTHESIS_CONTROL_DONE); + SLOG(LOG_WARN, tts_tag(), "[SERVER WARNING] Current state is %d. The synthesized result is ignored.", state); + return TTSD_ERROR_NONE; + } + /* Synthesis is success */ if (TTSE_RESULT_EVENT_START == event) { SLOG(LOG_INFO, tts_tag(), "[SERVER] Event : TTSE_RESULT_EVENT_START");