Skip to content

Commit

Permalink
Only wait in whisper thread if input buffers are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
palana committed Aug 8, 2024
1 parent a4b5c1e commit 6414214
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/whisper-utils/whisper-processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,9 @@ void whisper_loop(void *data)
// This will wake up the thread if there is new data in the input buffer
// or if the whisper context is null
std::unique_lock<std::mutex> lock(gf->whisper_ctx_mutex);
gf->wshiper_thread_cv.wait_for(lock, std::chrono::milliseconds(50));
if (gf->input_buffers->size == 0) {
gf->wshiper_thread_cv.wait_for(lock, std::chrono::milliseconds(50));
}
}

obs_log(gf->log_level, "Exiting whisper thread");
Expand Down

0 comments on commit 6414214

Please sign in to comment.