diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-03-03 19:19:01 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-03-03 19:19:01 +0100 |
commit | 61f587cfc6f151570df169ae38158b6293aaddb8 (patch) | |
tree | 790dfd7292452564f52aad4f23ff0be6a31e46ee /pkg/mixer | |
parent | hack: listen on all addresses for websocket clients (diff) |
add go-modules support and fix midi library API changetopic/x32-midi
Diffstat (limited to 'pkg/mixer')
-rw-r--r-- | pkg/mixer/mixer.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/pkg/mixer/mixer.go b/pkg/mixer/mixer.go index 0eb5746..afa1534 100644 --- a/pkg/mixer/mixer.go +++ b/pkg/mixer/mixer.go @@ -273,15 +273,17 @@ func (m *Mixer) Init() error { go func() { for { - p := <-ch - if p.Err != nil { - log.Printf("mixer: got fatal error from midi input device: %v, trying to reopen it...", p.Err) - m.devIn.Close() - m.devIn = nil - go m.reopenInput() - return + ps := <-ch + for _, p := range ps { + if p.Err != nil { + log.Printf("mixer: got fatal error from midi input device: %v, trying to reopen it...", p.Err) + m.devIn.Close() + m.devIn = nil + go m.reopenInput() + return + } + m.handleMidiPacket(p) } - m.handleMidiPacket(p) } }() return nil |