if (mStreamingThread.joinable()) {
MWR_LOGD("mStreamingThread is joinable, trying join()");
mStopStreamingThread.store(true);
- mStreamingThread.join();
+ try {
+ mStreamingThread.join();
+ } catch (std::exception &e) {
+ MWR_LOGE("Exception thrown : %s", e.what());
+ }
}
mStopStreamingThread.store(false);
if (mStreamingPreviousThread.joinable()) {
MWR_LOGD("mStreamingPreviousThread is joinable, trying join()");
mStopStreamingPreviousThread.store(true);
- mStreamingPreviousThread.join();
+ try {
+ mStreamingPreviousThread.join();
+ } catch (std::exception &e) {
+ MWR_LOGE("Exception thrown : %s", e.what());
+ }
}
mStopStreamingThread.store(false);
}
return ret;
}
+static Eina_Bool handle_speech_streaming_event_failure(void *data)
+{
+ mas_client_send_recognition_result(0, MA_RECOGNITION_RESULT_EVENT_ERROR);
+ return ECORE_CALLBACK_CANCEL;
+}
+
static void __audio_streaming_cb(wakeup_speech_streaming_event_e event, unsigned char* buffer, int len, void *user_data)
{
if (event == WAKEUP_SPEECH_STREAMING_EVENT_FAIL) {
- mas_client_send_recognition_result(0, MA_RECOGNITION_RESULT_EVENT_ERROR);
+ ecore_thread_main_loop_begin();
+ ecore_timer_add(0.0f, handle_speech_streaming_event_failure, NULL);
+ ecore_thread_main_loop_begin();
return;
}
static int count = 0;