From 35494d33f338ee9e7f112c9d8d96b1e7502219ec Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Wed, 13 Dec 2017 15:55:09 +0900 Subject: [PATCH] Add recorder destroy when bt recording is failed Change-Id: I06c00fcfa474cb04e2883f30e249e39975249e0d Signed-off-by: sooyeon.kim (cherry picked from commit 65f305644e81cf5fada4230bf7edbf63851ae3b5) --- server/sttd_recorder.c | 16 ++++++++++++++++ server/sttd_recorder.h | 1 + server/sttd_server.c | 2 ++ 3 files changed, 19 insertions(+) diff --git a/server/sttd_recorder.c b/server/sttd_recorder.c index b83cc47..e1b0e82 100644 --- a/server/sttd_recorder.c +++ b/server/sttd_recorder.c @@ -713,3 +713,19 @@ int sttd_recorder_stop_file() return 0; } + +int sttd_recorder_reset() +{ +#ifdef TV_BT_MODE + SLOG(LOG_DEBUG, TAG_STTD, "[Recorder DEBUG] Reset recorder on TV"); + + if (STTD_RECORDER_STATE_RECORDING == g_recorder_state) { + sttd_recorder_stop(); + } + if (STTD_RECORDER_STATE_READY == g_recorder_state) { + sttd_recorder_destroy(); + } +#endif + + return STTD_ERROR_NONE; +} diff --git a/server/sttd_recorder.h b/server/sttd_recorder.h index 3c27c87..fa599c1 100644 --- a/server/sttd_recorder.h +++ b/server/sttd_recorder.h @@ -46,6 +46,7 @@ int sttd_recorder_start_file(int uid, const char *filepath); int sttd_recorder_stop_file(); +int sttd_recorder_reset(); #ifdef __cplusplus } diff --git a/server/sttd_server.c b/server/sttd_server.c index cf727a7..0213b5e 100644 --- a/server/sttd_server.c +++ b/server/sttd_server.c @@ -222,6 +222,8 @@ int __server_recognition_result_callback(stte_result_event_e event, const char* sttd_config_time_save(); sttd_config_time_reset(); + sttd_recorder_reset(); + sttd_client_set_state(uid, APP_STATE_READY); stt_client_unset_current_recognition(); -- 2.7.4