Skip to content

Commit

Permalink
Don't close channel which not yet started
Browse files Browse the repository at this point in the history
  • Loading branch information
nshmyrev committed Jan 9, 2022
1 parent c320997 commit c6fab36
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/batch_recognizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,14 @@ BatchRecognizer::~BatchRecognizer() {

void BatchRecognizer::FinishStream(uint64_t id)
{
Vector<BaseFloat> wave;
SubVector<BaseFloat> chunk(wave.Data(), 0);
dynamic_batcher_->Push(id, false, true, chunk);
streams_.erase(id);
if (streams_.find(id) != streams_.end()) {
Vector<BaseFloat> wave;
SubVector<BaseFloat> chunk(wave.Data(), 0);
dynamic_batcher_->Push(id, false, true, chunk);
streams_.erase(id);
}
}


void BatchRecognizer::PushLattice(uint64_t id, CompactLattice &clat, BaseFloat offset)
{
fst::ScaleLattice(fst::GraphLatticeScale(0.9), &clat);
Expand Down

0 comments on commit c6fab36

Please sign in to comment.