From 8b2597862b536c55dd744a0d976db963e7e38f38 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 10 Oct 2015 20:47:41 +0200 Subject: add output flushing --- apps/mixer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/mixer.c b/apps/mixer.c index 1e3287f..418fcb3 100644 --- a/apps/mixer.c +++ b/apps/mixer.c @@ -78,6 +78,11 @@ int mixer_handle_revents(mixer_t* m, struct pollfd *pfds, int npfds) error(0, 0, "MIXER: cannot write to midi port: %s", snd_strerror(ret)); return -1; } + assert(ret == sizeof(buf)); // TODO: try again?? + if((err = snd_rawmidi_drain(m->output_)) < 0) { + error(0, 0, "MIXER: cannot drain output: %s", snd_strerror(err)); + return -1; + } return 0; } -- cgit v1.2.3