From 8951768b0314375bd4eeeea8747821e2f2958b98 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Wed, 25 Sep 2019 19:47:05 +0900 Subject: [PATCH] Add unset callback Change-Id: I27a2e3a237f161159cf440de6d2d3a43da25900c --- common/stt_engine.c | 8 ++++++++ common/stt_engine.h | 2 ++ server/stte.c | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) 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"); } -- 2.7.4