mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-17 20:44:29 -04:00
fix(tracker): do not close Broker but rather just close the detector
This commit is contained in:
parent
943073d0cc
commit
94058c2603
@ -106,6 +106,9 @@ func (s *Detector) Run() {
|
||||
s.loudnessDetector.reset()
|
||||
s.peakDetector.reset()
|
||||
}
|
||||
if msg.Quit {
|
||||
return
|
||||
}
|
||||
switch data := msg.Data.(type) {
|
||||
case *sointu.AudioBuffer:
|
||||
buf := *data
|
||||
@ -144,6 +147,11 @@ func (s *Detector) Run() {
|
||||
}
|
||||
}
|
||||
|
||||
// Close may theoretically block if the broker is full, but it should not happen in practice
|
||||
func (s *Detector) Close() {
|
||||
s.broker.ToDetector <- MsgToDetector{Quit: true}
|
||||
}
|
||||
|
||||
func makeLoudnessDetector(weighting WeightingType) loudnessDetector {
|
||||
return loudnessDetector{
|
||||
weighting: weightings[weighting],
|
||||
|
Reference in New Issue
Block a user