From 1e45a9503e1990b4023da2950ec47ea6070d8b42 Mon Sep 17 00:00:00 2001 From: you zou <54074779+zou-you@users.noreply.github.com> Date: Thu, 2 Mar 2023 09:51:36 +0800 Subject: [PATCH] fix bugs (#73) --- sherpa-onnx/csrc/features.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sherpa-onnx/csrc/features.cc b/sherpa-onnx/csrc/features.cc index ed90b58a..b0defc50 100644 --- a/sherpa-onnx/csrc/features.cc +++ b/sherpa-onnx/csrc/features.cc @@ -90,7 +90,10 @@ class FeatureExtractor::Impl { return features; } - void Reset() { fbank_ = std::make_unique(opts_); } + void Reset() { + std::lock_guard lock(mutex_); + fbank_ = std::make_unique(opts_); + } int32_t FeatureDim() const { return opts_.mel_opts.num_bins; }