@@ -309,12 +309,12 @@ class llm_task {
309309 static int count = 0 ;
310310 double start, end;
311311 double start_all, end_all;
312-
313- if (count < delay_audio_frame_ || endpoint_flage_) {
312+ if (count < delay_audio_frame_) {
314313 buffer_write_char (pcmdata, raw.c_str (), raw.length ());
315314 count++;
316- return ;
315+ if (endpoint_flage_) return ;
317316 }
317+ endpoint_flage_ = true ;
318318 buffer_write_char (pcmdata, raw.c_str (), raw.length ());
319319 buffer_position_set (pcmdata, 0 );
320320 count = 0 ;
@@ -823,7 +823,7 @@ class llm_whisper : public StackFlow {
823823 std::weak_ptr<llm_channel_obj>(llm_channel), std::placeholders::_1,
824824 std::placeholders::_2));
825825 } else if (input.find (" vad" ) != std::string::npos) {
826- llm_task_obj->endpoint_flage_ = false ;
826+ llm_task_obj->endpoint_flage_ = true ;
827827 // task_pause(work_id, "");
828828 llm_channel->subscriber_work_id (
829829 input, std::bind (&llm_whisper::vad_endpoint, this , std::weak_ptr<llm_task>(llm_task_obj),
@@ -874,7 +874,7 @@ class llm_whisper : public StackFlow {
874874 std::weak_ptr<llm_channel_obj>(llm_channel), std::placeholders::_1, std::placeholders::_2));
875875 llm_task_obj->inputs_ .push_back (data);
876876 } else if (data.find (" vad" ) != std::string::npos) {
877- llm_task_obj->endpoint_flage_ = false ;
877+ llm_task_obj->endpoint_flage_ = true ;
878878 ret = llm_channel->subscriber_work_id (
879879 data,
880880 std::bind (&llm_whisper::vad_endpoint, this , std::weak_ptr<llm_task>(llm_task_obj),
0 commit comments