diff options
author | Ji-hoon Lee <dalton.lee@samsung.com> | 2020-08-07 15:25:06 +0900 |
---|---|---|
committer | Ji-hoon Lee <dalton.lee@samsung.com> | 2020-08-07 17:41:32 +0900 |
commit | fe16d7610ebe5d86ec24df523118ab1bfaf0cb96 (patch) | |
tree | 97ca77918bbe6df36cff7f3cf0f450cea9df7c33 | |
parent | 6b26929dd1f6dc252d3fe89e6532aab4724b4743 (diff) | |
download | multi-assistant-service-fe16d7610ebe5d86ec24df523118ab1bfaf0cb96.tar.gz multi-assistant-service-fe16d7610ebe5d86ec24df523118ab1bfaf0cb96.tar.bz2 multi-assistant-service-fe16d7610ebe5d86ec24df523118ab1bfaf0cb96.zip |
Fix bug NULL is passed on streaming failure event
Change-Id: I5b2900a9110d10051bfa028deb0ab5adf5f24a4e
-rw-r--r-- | src/service_plugin.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/service_plugin.cpp b/src/service_plugin.cpp index ca4416c..254fb8e 100644 --- a/src/service_plugin.cpp +++ b/src/service_plugin.cpp @@ -350,8 +350,15 @@ void handle_speech_streaming_event_failure(void* data) static void __audio_streaming_cb(mas_speech_streaming_event_e event, void* buffer, int len, void *user_data) { + CServicePlugin* plugin = static_cast<CServicePlugin*>(user_data); + if (event == MAS_SPEECH_STREAMING_EVENT_FAIL) { - ecore_main_loop_thread_safe_call_async(handle_speech_streaming_event_failure, NULL); + AsyncParam* param = new(std::nothrow) AsyncParam; + if (param) { + param->plugin = plugin; + ecore_main_loop_thread_safe_call_async( + handle_speech_streaming_event_failure, static_cast<void*>(param)); + } return; } static int count = 0; @@ -361,7 +368,6 @@ static void __audio_streaming_cb(mas_speech_streaming_event_e event, void* buffe } ++count; - CServicePlugin* plugin = static_cast<CServicePlugin*>(user_data); CServiceIpcDbus* service_ipc = nullptr; CServiceMain* service_main = nullptr; if (plugin) { |