add API to Evoral::SMF to retrieve all track/instrument names for use when importing
[ardour.git] / libs / ardour / delivery.cc
index bc49c9be69bc126248e4100762cccaed58fc21d7..d95e32a02f4132869a717d3fadfc2623d9cec692 100644 (file)
@@ -326,19 +326,21 @@ Delivery::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, do
        }
 
        if (result_required) {
-
                /* "bufs" are internal, meaning they should never reflect
                   split-cycle offsets. So shift events back in time from where
                   they were for the external buffers associated with Ports.
                */
 
-               BufferSet& outs (output_buffers());
+               const BufferSet& outs (output_buffers());
+               bufs.set_count (output_buffers().count ());
 
                for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
 
                        uint32_t n = 0;
-
                        for (BufferSet::iterator b = bufs.begin (*t); b != bufs.end (*t); ++b) {
+                               if (outs.count ().get (*t) <= n) {
+                                       continue;
+                               }
                                b->read_from (outs.get (*t, n++), nframes, (*t == DataType::AUDIO ? 0 : -Port::port_offset()));
                        }
                }
@@ -515,7 +517,7 @@ Delivery::transport_stopped (framepos_t now)
 void
 Delivery::realtime_locate ()
 {
-        if (_output) {
+       if (_output) {
                 PortSet& ports (_output->ports());
 
                 for (PortSet::iterator i = ports.begin(); i != ports.end(); ++i) {