From cdcc0e02820afb766b43392f1a517c0a5267c8bb Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 1 Feb 2010 17:25:43 +0000 Subject: [PATCH] silence extra buffers not handled/touched/filled by an AU (e.g. 2in/1out - silence the 2nd buffer) git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@6610 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audio_unit.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index acde4e7e0a..56a25e2d16 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -1207,6 +1207,15 @@ AUPlugin::connect_and_run (vector& bufs, uint32_t maxbuf, int32_t& in, memcpy (bufs[i]+offset, buffers->mBuffers[i].mData, nframes * sizeof (Sample)); } } + + /* now silence any buffers that were passed in but the that the plugin + did not fill/touch/use. + */ + + for (i < maxbuf) { + memset (bufs[i]+offset, 0, nframes * sizeof (Sample)); + } + return 0; }