From 1feaa65d167e59b400b8ac003f69e33934ee7c08 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 3 Dec 2012 21:39:59 +0000 Subject: do not try to write from JackMIDIPort::write() if we are disconnected from JACK. should fix erroneous behaviour when MMC tries to send stop messages after JACK disconnects git-svn-id: svn://localhost/ardour2/branches/3.0@13594 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/midi++2/jack_midi_port.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs') diff --git a/libs/midi++2/jack_midi_port.cc b/libs/midi++2/jack_midi_port.cc index 10274ad859..ff26a84e4b 100644 --- a/libs/midi++2/jack_midi_port.cc +++ b/libs/midi++2/jack_midi_port.cc @@ -214,6 +214,13 @@ JackMIDIPort::write (const byte * msg, size_t msglen, timestamp_t timestamp) { int ret = 0; + if (!_jack_client || !_jack_port) { + /* poof ! make it just vanish into thin air, since we are no + longer connected to JACK. + */ + return msglen; + } + if (!sends_output()) { return ret; } -- cgit v1.2.3