From d20c030e5b75306dd67e8fe9924d5d94eac1bf30 Mon Sep 17 00:00:00 2001
From: wusong <63332221+wusong1128@users.noreply.github.com>
Date: 星期三, 25 九月 2024 15:11:50 +0800
Subject: [PATCH] 解决python ws服务针对尾部非人声录音无结束标识返回的问题 (#2102)

---
 runtime/onnxruntime/src/encode_converter.cpp |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/runtime/onnxruntime/src/encode_converter.cpp b/runtime/onnxruntime/src/encode_converter.cpp
index 6c1097e..2ba6109 100644
--- a/runtime/onnxruntime/src/encode_converter.cpp
+++ b/runtime/onnxruntime/src/encode_converter.cpp
@@ -441,7 +441,7 @@
 }
 
 bool EncodeConverter::IsAllChineseCharactor(const U8CHAR_T* pu8, size_t ilen) {
-    if (pu8 == NULL || ilen <= 0) {
+    if (pu8 == nullptr || ilen <= 0) {
         return false;
     }
 
@@ -458,7 +458,7 @@
 }
 
 bool EncodeConverter::HasAlpha(const U8CHAR_T* pu8, size_t ilen) {
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   for (size_t i = 0; i < ilen; i++) {
@@ -471,7 +471,7 @@
 
 
 bool EncodeConverter::IsAllAlpha(const U8CHAR_T* pu8, size_t ilen) {
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   for (size_t i = 0; i < ilen; i++) {
@@ -483,7 +483,7 @@
 }
 
 bool EncodeConverter::IsAllAlphaAndPunct(const U8CHAR_T* pu8, size_t ilen) {
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   bool flag1 = HasAlpha(pu8, ilen);
@@ -500,7 +500,7 @@
 }
 
 bool EncodeConverter::IsAllAlphaAndDigit(const U8CHAR_T* pu8, size_t ilen) {
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   bool flag1 = HasAlpha(pu8, ilen);
@@ -516,7 +516,7 @@
   return true;
 }
 bool EncodeConverter::IsAllAlphaAndDigitAndBlank(const U8CHAR_T* pu8, size_t ilen) {
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   for (size_t i = 0; i < ilen; i++) {
@@ -529,7 +529,7 @@
 bool EncodeConverter::NeedAddTailBlank(std::string str) {
   U8CHAR_T *pu8 = (U8CHAR_T*)str.data();
   size_t ilen = str.size();
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   if (IsAllAlpha(pu8, ilen) || IsAllAlphaAndPunct(pu8, ilen) || IsAllAlphaAndDigit(pu8, ilen)) {

--
Gitblit v1.9.1