Skip to content

Commit

Permalink
fix on closed channel
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodz committed Jan 22, 2025
1 parent c67fa22 commit 36c8e18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fastaudiosocket/fastaudiosocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ func (s *FastAudioSocket) streamRead(wg *sync.WaitGroup) {
if s.debug {
fmt.Printf("Failed to read packet: %v\n", err)
}
s.PacketChan <- PacketReader{Type: PacketTypeError}

select {
case s.PacketChan <- PacketReader{Type: PacketTypeError}:
default:
}
return
}
atomic.AddInt32(&s.chunkCounter, 1)
Expand Down

0 comments on commit 36c8e18

Please sign in to comment.