13
0

exit early from AsyncMIDIPort::drain() if it will never be used in a process callback again

This commit is contained in:
Paul Davis 2013-09-06 10:38:49 -04:00
parent 94efddd240
commit 018465f739

View File

@ -145,6 +145,12 @@ AsyncMIDIPort::drain (int check_interval_usecs)
{
RingBuffer< Evoral::Event<double> >::rw_vector vec = { { 0, 0 }, { 0, 0} };
if (!AudioEngine::instance()->running() || AudioEngine::instance()->session() == 0) {
/* no more process calls - it will never drain */
return;
}
if (is_process_thread()) {
error << "Process thread called MIDI::AsyncMIDIPort::drain() - this cannot work" << endmsg;
return;