From: wn.jang Date: Wed, 25 Sep 2019 10:47:05 +0000 (+0900) Subject: Add unset callback X-Git-Tag: submit/tizen/20190926.014455^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fstt.git;a=commitdiff_plain;h=refs%2Fchanges%2F01%2F214701%2F1 Add unset callback Change-Id: I27a2e3a237f161159cf440de6d2d3a43da25900c --- diff --git a/common/stt_engine.c b/common/stt_engine.c index 532381d..6a7434f 100644 --- a/common/stt_engine.c +++ b/common/stt_engine.c @@ -880,4 +880,12 @@ int stt_engine_set_audio_type_set_cb(stte_audio_type_cb audio_type_set_cb, void* g_set_audio_type_user_data = user_data; return 0; +} + +int stt_engine_unset_audio_type_set_cb(void) +{ + g_set_audio_type_cb = NULL; + g_set_audio_type_user_data = NULL; + + return 0; } \ No newline at end of file diff --git a/common/stt_engine.h b/common/stt_engine.h index b345aed..9ae9f6c 100644 --- a/common/stt_engine.h +++ b/common/stt_engine.h @@ -104,6 +104,8 @@ int stt_engine_set_audio_type(const char* audio_type); int stt_engine_set_audio_type_set_cb(stte_audio_type_cb audio_type_set_cb, void* user_data); +int stt_engine_unset_audio_type_set_cb(void); + #ifdef __cplusplus } #endif diff --git a/server/stte.c b/server/stte.c index c623b6a..bcc97c1 100755 --- a/server/stte.c +++ b/server/stte.c @@ -130,7 +130,7 @@ int stte_unset_audio_type_set_cb(stte_audio_type_cb callback) SLOG(LOG_INFO, TAG_STTD, "[Server Info] Unset audio type set callback"); int ret = STTE_ERROR_NONE; - ret = stt_engine_set_audio_type_set_cb(callback, NULL); + ret = stt_engine_unset_audio_type_set_cb(); if (0 != ret) { SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to unset audio type set"); }