Use a few shared_ptrs to make things slightly neater.
[ardour.git] / libs / ardour / panner_shell.cc
index fae60c3458b36916d4b71ce6250c43ef3a5f0868..fc72a27b09ea71b4b87c3d2fc8dc1cda1d01e87f 100644 (file)
@@ -53,6 +53,7 @@
 #include "ardour/panner_shell.h"
 #include "ardour/runtime_functions.h"
 #include "ardour/session.h"
+#include "ardour/speakers.h"
 #include "ardour/utils.h"
 
 #include "i18n.h"
@@ -73,7 +74,7 @@ PannerShell::PannerShell (string name, Session& s, boost::shared_ptr<Pannable> p
 
 PannerShell::~PannerShell ()
 {
-       DEBUG_TRACE(DEBUG::Destruction, string_compose ("panner shell for %1 destructor, pannable is %2\n", _name, _pannable));
+       DEBUG_TRACE(DEBUG::Destruction, string_compose ("panner shell %3 for %1 destructor, panner is %4, pannable is %2\n", _name, _pannable, this, _panner));
 }
 
 void
@@ -117,7 +118,7 @@ PannerShell::configure_io (ChanCount in, ChanCount out)
        }
 
        Panner* p = pi->descriptor.factory (_pannable, speakers);
-       boost_debug_shared_ptr_mark_interesting (p, "Panner");
+       // boost_debug_shared_ptr_mark_interesting (p, "Panner");
        _panner.reset (p);
        _panner->configure_io (in, out);
 
@@ -271,6 +272,14 @@ PannerShell::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, pf
 void
 PannerShell::run (BufferSet& inbufs, BufferSet& outbufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes)
 {
+       if (inbufs.count().n_audio() == 0) {
+               /* Input has no audio buffers (e.g. Aux Send in a MIDI track at a
+                  point with no audio because there is no preceding instrument)
+               */
+               outbufs.silence(nframes, 0);
+               return;
+       }
+
        if (outbufs.count().n_audio() == 0) {
                // Failing to deliver audio we were asked to deliver is a bug
                assert(inbufs.count().n_audio() == 0);