Prevent garbage preset names with VST plugins when the call to get preset name fails.
[ardour.git] / libs / ardour / midi_track.cc
index c994350ebcf5a545a3d9c96e0b7a3d4f4170ee05..cdd4633448e7590138d83354a153b61319c88920 100644 (file)
@@ -379,9 +379,11 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
 
                write_out_of_band_data (bufs, start_frame, end_frame, nframes);
 
-               process_output_buffers (bufs, start_frame, end_frame, nframes,
-                                       (!_session.get_record_enabled() || !Config->get_do_not_record_plugins()), declick);
+               /* final argument: don't waste time with automation if we're recording or we've just stopped (yes it can happen) */
 
+               process_output_buffers (bufs, start_frame, end_frame, nframes,
+                                       (!_session.get_record_enabled() || !Config->get_do_not_record_plugins()), declick,
+                                        (!diskstream->record_enabled() && !_session.transport_stopped()));
        }
 
        _main_outs->flush_buffers (nframes, end_frame - start_frame - 1);
@@ -403,9 +405,16 @@ MidiTrack::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fr
 }
 
 void
-MidiTrack::handle_transport_stopped (bool abort, bool did_locate, bool flush_processors)
+MidiTrack::realtime_handle_transport_stopped ()
 {
-       Route::handle_transport_stopped (abort, did_locate, flush_processors);
+       Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
+       if (!lm.locked ()) {
+               return;
+       }
+
+       for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
+               (*i)->realtime_handle_transport_stopped ();
+       }
 }
 
 void