continue;
}
- if (getpid() == feedback_data->pid) {
- vc_mgr_feedback_streaming_cb callback = NULL;
- void* user_data = NULL;
-
- vc_mgr_client_get_feedback_streaming_cb(g_vc_m, &callback, &user_data);
- if (NULL == callback) {
- SLOG(LOG_WARN, TAG_VCM, "[WARNING] TTS feedback streaming callback is null");
- return;
- }
+ if (NULL != feedback_data) {
+ if (getpid() == feedback_data->pid) {
+ vc_mgr_feedback_streaming_cb callback = NULL;
+ void* user_data = NULL;
+
+ vc_mgr_client_get_feedback_streaming_cb(g_vc_m, &callback, &user_data);
+ if (NULL == callback) {
+ SLOG(LOG_WARN, TAG_VCM, "[WARNING] TTS feedback streaming callback is null");
+ vc_mgr_data_clear_feedback_data(&feedback_data);
+ return;
+ }
- SLOG(LOG_DEBUG, TAG_VCM, "TTS feedback streaming callback is called");
- vc_mgr_client_use_callback(g_vc_m);
- callback(feedback_data->event, feedback_data->data, feedback_data->data_size, user_data);
- vc_mgr_client_not_use_callback(g_vc_m);
+ SLOG(LOG_DEBUG, TAG_VCM, "TTS feedback streaming callback is called");
+ vc_mgr_client_use_callback(g_vc_m);
+ callback(feedback_data->event, feedback_data->data, feedback_data->data_size, user_data);
+ vc_mgr_client_not_use_callback(g_vc_m);
- /* If no feedback data and EVENT_FINISH */
- if (0 >= vc_mgr_data_get_feedback_data_size() && VC_FEEDBACK_EVENT_FINISH == feedback_data->event) {
- SLOG(LOG_INFO, TAG_VCM, "[INFO] Finish feedback");
- break;
- }
- } else {
- vc_mgr_vc_tts_streaming_cb callback = NULL;
- void* user_data = NULL;
-
- vc_mgr_client_get_vc_tts_streaming_cb(g_vc_m, &callback, &user_data);
- if (NULL == callback) {
- SLOG(LOG_WARN, TAG_VCM, "[WARNING] vc tts streaming callback is null");
- vc_mgr_data_clear_feedback_data(&feedback_data);
- return;
- }
+ /* If no feedback data and EVENT_FINISH */
+ if (0 >= vc_mgr_data_get_feedback_data_size() && VC_FEEDBACK_EVENT_FINISH == feedback_data->event) {
+ SLOG(LOG_INFO, TAG_VCM, "[INFO] Finish feedback");
+ break;
+ }
+ } else {
+ vc_mgr_vc_tts_streaming_cb callback = NULL;
+ void* user_data = NULL;
- SLOG(LOG_DEBUG, TAG_VCM, "vc tts feedback streaming callback is called");
- vc_mgr_client_use_callback(g_vc_m);
- callback(feedback_data->pid, feedback_data->utt_id, feedback_data->event, feedback_data->data, feedback_data->data_size, user_data);
- vc_mgr_client_not_use_callback(g_vc_m);
+ vc_mgr_client_get_vc_tts_streaming_cb(g_vc_m, &callback, &user_data);
+ if (NULL == callback) {
+ SLOG(LOG_WARN, TAG_VCM, "[WARNING] vc tts streaming callback is null");
+ vc_mgr_data_clear_feedback_data(&feedback_data);
+ return;
+ }
- /* If no feedback data and EVENT_FINISH */
- if (0 >= vc_mgr_data_get_feedback_data_size() && VC_FEEDBACK_EVENT_FINISH == feedback_data->event) {
- SLOG(LOG_INFO, TAG_VCM, "[INFO] Finish vc tts feedback");
- break;
+ SLOG(LOG_DEBUG, TAG_VCM, "vc tts feedback streaming callback is called");
+ vc_mgr_client_use_callback(g_vc_m);
+ callback(feedback_data->pid, feedback_data->utt_id, feedback_data->event, feedback_data->data, feedback_data->data_size, user_data);
+ vc_mgr_client_not_use_callback(g_vc_m);
+
+ /* If no feedback data and EVENT_FINISH */
+ if (0 >= vc_mgr_data_get_feedback_data_size() && VC_FEEDBACK_EVENT_FINISH == feedback_data->event) {
+ SLOG(LOG_INFO, TAG_VCM, "[INFO] Finish vc tts feedback");
+ break;
+ }
}
- }
- if (feedback_data)
free(feedback_data);
+ feedback_data = NULL;
+ }
}
}