diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-05 01:13:52 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-05 01:13:52 +0000 |
commit | 839402778fa0d6572395d104c1fe4a3a4fa904d5 (patch) | |
tree | 70122daee110fb4c42a0ccd232bb789b8f33e134 | |
parent | c36132271b9c217af2242fc490b0cd05ce9a641d (diff) |
Prevent assertion failure if _jack_output_port is 0, which can happen if JACK is disconnected. Improves #3301.
git-svn-id: svn://localhost/ardour2/branches/3.0@7371 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/midi++2/jack_midiport.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/midi++2/jack_midiport.cc b/libs/midi++2/jack_midiport.cc index eb8b6a072a..07b044f077 100644 --- a/libs/midi++2/jack_midiport.cc +++ b/libs/midi++2/jack_midiport.cc @@ -132,6 +132,10 @@ JACK_MidiPort::write(byte * msg, size_t msglen, timestamp_t timestamp) { int ret = 0; + if (!_jack_output_port) { + return ret; + } + if (!is_process_thread()) { Glib::Mutex::Lock lm (output_fifo_lock); @@ -162,8 +166,6 @@ JACK_MidiPort::write(byte * msg, size_t msglen, timestamp_t timestamp) } else { - assert(_jack_output_port); - // XXX This had to be temporarily commented out to make export work again if (!(timestamp < _nframes_this_cycle)) { std::cerr << "assertion timestamp < _nframes_this_cycle failed!" << std::endl; |