Make panner tolerate 0 audio inputs (fix #4353).
authorDavid Robillard <d@drobilla.net>
Fri, 7 Oct 2011 16:30:27 +0000 (16:30 +0000)
committerDavid Robillard <d@drobilla.net>
Fri, 7 Oct 2011 16:30:27 +0000 (16:30 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@10194 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/panner_shell.cc

index fae60c3458b36916d4b71ce6250c43ef3a5f0868..8c0236bd9fec356155f5f6fa2524487a78846839 100644 (file)
@@ -271,6 +271,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);