summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-08-09 18:06:08 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-08-09 18:06:08 -0400
commit4b9289e17e64431041bc50ff00f0cd64e56e752c (patch)
tree75badbc97dda2bab91431fdcbeb801b8d951d2ab /libs
parentcec2a3da36e49e22805e039ad99013f5480cebce (diff)
don't waste time with sending MTC or MMC after stop if we're disconnected from the engine.
Also, add note about threading oddities with send_mmc_locate() being called from ::non_realtime_stop() which gets called from a *realtime* context.
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/session_transport.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 44a885cd1c..1e492741b8 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -609,12 +609,23 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
have_looped = false;
- if (!_engine.freewheeling()) {
+ /* don't bother with this stuff if we're disconnected from the engine,
+ because there will be no process callbacks to deliver stuff from
+ */
+
+ if (_engine.connected() && !_engine.freewheeling()) {
// need to queue this in the next RT cycle
_send_timecode_update = true;
if (!dynamic_cast<MTC_Slave*>(_slave)) {
AudioEngine::instance()->mmc().send (MIDI::MachineControlCommand (MIDI::MachineControl::cmdStop));
+
+ /* This (::non_realtime_stop()) gets called by main
+ process thread, which will lead to confusion
+ when calling AsyncMIDIPort::write().
+
+ Something must be done. XXX
+ */
send_mmc_locate (_transport_frame);
}
}