From fe588bc508c0076bb007d6ed36c18ac8ecb341ac Mon Sep 17 00:00:00 2001
From: 王梦迪 <73778524+di-osc@users.noreply.github.com>
Date: 星期二, 20 五月 2025 16:10:59 +0800
Subject: [PATCH] Fsmn_vad支持多线程并发调用 (#2519)

---
 runtime/onnxruntime/src/audio.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/runtime/onnxruntime/src/audio.cpp b/runtime/onnxruntime/src/audio.cpp
index a5a44ca..22a9ecd 100644
--- a/runtime/onnxruntime/src/audio.cpp
+++ b/runtime/onnxruntime/src/audio.cpp
@@ -1061,8 +1061,9 @@
     #ifdef USE_GPU
         max_batch = batch_size;
     #endif
+    max_batch = std::min(max_batch, (int)frame_queue.size());
 
-    for(int idx=0; idx < std::min(max_batch, (int)frame_queue.size()); idx++){
+    for(int idx=0; idx < max_batch; idx++){
         AudioFrame *frame = frame_queue.front();
         int length = frame->GetLen();
         if(length >= max_sent){

--
Gitblit v1.9.1