summaryrefslogtreecommitdiff
path: root/apps/midi.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/midi.c')
-rw-r--r--apps/midi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/midi.c b/apps/midi.c
index 77a6de6..955796e 100644
--- a/apps/midi.c
+++ b/apps/midi.c
@@ -34,6 +34,7 @@ int midi_init(midi_t* m, const char* device)
{
assert(m != NULL);
+ m->input_ = NULL;
int ret = snd_rawmidi_open(&(m->input_), NULL, device, SND_RAWMIDI_NONBLOCK);
if(ret < 0) {
error(0, 0, "MIDI: cannot open port '%s': %s", device, snd_strerror(ret));
@@ -70,7 +71,7 @@ int midi_handle_revents(midi_t* m, struct pollfd *pfds, int npfds)
u_int8_t buf[256];
int ret = snd_rawmidi_read(m->input_, buf, sizeof(buf));
- if (ret == -EAGAIN)
+ if(ret == -EAGAIN)
return 0;
if(ret < 0) {
error(0, 0, "MIDI: cannot read from midi port: %s", snd_strerror(ret));