Also flush buffers of the inner delivery of inserts
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Thu, 14 Jul 2016 23:51:55 +0000 (01:51 +0200)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 15 Jul 2016 01:55:49 +0000 (21:55 -0400)
When flushing the buffers of Delivery processors owned by a Route/Track,
inner deliveries of PortInsert processors were missed since PortInsert
is not a Delivery subclass, but rather owns a Delivery as a private
member. Expose a flush_buffers() for PortInsert and call it too.

This is correct since (external) Send is a Delivery subclass, so that
just makes the send part of inserts behave as external sends do.

libs/ardour/ardour/port_insert.h
libs/ardour/route.cc

index fee1f4694c7e2463d6ca1ae5257a710428f5d2fa..0b1b3fbc009e94c7336464757992de519f1b5950 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "ardour/ardour.h"
 #include "ardour/io_processor.h"
+#include "ardour/delivery.h"
 #include "ardour/libardour_visibility.h"
 #include "ardour/types.h"
 
@@ -54,6 +55,10 @@ class LIBARDOUR_API PortInsert : public IOProcessor
 
        void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, double speed, pframes_t nframes, bool);
 
+       void flush_buffers (framecnt_t nframes) {
+               _out->flush_buffers (nframes);
+       }
+
        framecnt_t signal_latency () const;
 
        bool set_name (const std::string& name);
index cd670df02e1a759dfb63c1ee6bbcace179cb4edd..1e1be37d9f941d5309a8d66ac123507a4a27cb87 100644 (file)
@@ -3398,6 +3398,11 @@ Route::flush_processor_buffers_locked (framecnt_t nframes)
                boost::shared_ptr<Delivery> d = boost::dynamic_pointer_cast<Delivery> (*i);
                if (d) {
                        d->flush_buffers (nframes);
+               } else {
+                       boost::shared_ptr<PortInsert> p = boost::dynamic_pointer_cast<PortInsert> (*i);
+                       if (p) {
+                               p->flush_buffers (nframes);
+                       }
                }
        }
 }