Fix bounce-process: skip all processors before disk-reader
authorRobin Gareus <robin@gareus.org>
Sun, 7 Apr 2019 17:36:35 +0000 (19:36 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 7 Apr 2019 17:52:12 +0000 (19:52 +0200)
libs/ardour/route.cc

index 2f3f53306f2e69ac442a03ec2f55b10b465a0025..793c18d20cd152eeb21de8168e3c1d2a7c9714dc 100644 (file)
@@ -543,12 +543,21 @@ Route::bounce_process (BufferSet& buffers, samplepos_t start, samplecnt_t nframe
        _trim->setup_gain_automation (start, start + nframes, nframes);
 
        latency = 0;
+       bool seen_disk_io = false;
        for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
 
                if (!include_endpoint && (*i) == endpoint) {
                        break;
                }
 
+               if (!for_export && !seen_disk_io) {
+                       if (boost::dynamic_pointer_cast<DiskReader> (*i)) {
+                               seen_disk_io = true;
+                               buffers.set_count ((*i)->output_streams());
+                       }
+                       continue;
+               }
+
                /* if we're *not* exporting, stop processing if we come across a routing processor. */
                if (!for_export && boost::dynamic_pointer_cast<PortInsert>(*i)) {
                        break;
@@ -593,10 +602,17 @@ Route::bounce_get_latency (boost::shared_ptr<Processor> endpoint,
                return latency;
        }
 
+       bool seen_disk_io = false;
        for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
                if (!include_endpoint && (*i) == endpoint) {
                        break;
                }
+               if (!for_export && !seen_disk_io) {
+                       if (boost::dynamic_pointer_cast<DiskReader> (*i)) {
+                               seen_disk_io = true;
+                       }
+                       continue;
+               }
                if (!for_export && boost::dynamic_pointer_cast<PortInsert>(*i)) {
                        break;
                }