Prevent garbage preset names with VST plugins when the call to get preset name fails.
[ardour.git] / libs / ardour / internal_send.cc
index a1425e3059d998863da2418652e7085644532095..43276516ddfa53375ea16699845e70607c86c4e3 100644 (file)
@@ -34,6 +34,7 @@ using namespace std;
 
 InternalSend::InternalSend (Session& s, boost::shared_ptr<MuteMaster> mm, boost::shared_ptr<Route> sendto, Delivery::Role role)
        : Send (s, mm, role)
+       , target (0)
 {
         if (sendto) {
                 if (use_target (sendto)) {
@@ -80,7 +81,7 @@ InternalSend::send_to_going_away ()
 }
 
 void
-InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes, bool)
+InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool)
 {
        if ((!_active && !_pending_active) || !target || !_send_to) {
                _meter->reset ();
@@ -146,9 +147,14 @@ InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
 }
 
 int
-InternalSend::set_block_size (nframes_t nframes)
+InternalSend::set_block_size (pframes_t nframes)
 {
        mixbufs.ensure_buffers (_configured_input, nframes);
+
+       /* ensure that our target can cope with us merging this many frames to it */
+       if (target) {
+               target->ensure_buffers (_configured_input, nframes);
+       }
         return 0;
 }