diff options
author | Christian Pointner <equinox@spreadspace.org> | 2015-10-10 20:24:30 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2015-10-10 20:24:42 +0200 |
commit | 9950027ef8634045588e461a2e274c50dc893c0d (patch) | |
tree | d6d54a9998e64b3bb4c068cc202799c5be34fc94 /apps/midi.c | |
parent | improved poll() handling (diff) |
added mixer
Diffstat (limited to 'apps/midi.c')
-rw-r--r-- | apps/midi.c | 3 |
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)); |