From 1d6cb3bba47fb3139379541598bfdbc4c985dfda Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期五, 19 四月 2024 17:08:10 +0800
Subject: [PATCH] fix FetchDynamic

---
 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