From 17033c4448cfbf1a23ba1a1ecca1dd3ed93f3c55 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 26 Jan 2007 17:22:43 +0000 Subject: [PATCH] squash the dreaded noise-on-stop of guirja01 git-svn-id: svn://localhost/ardour2/trunk@1393 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/io.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 5e99a14fad..9442583379 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -570,10 +570,17 @@ IO::collect_input (vector& bufs, uint32_t nbufs, nframes_t nframes, nf /* fill any excess outputs with the last input */ - while (n < nbufs && last) { - // the dest buffer's offset has already been applied - memcpy (bufs[n], last, sizeof (Sample) * nframes); - ++n; + if (last) { + while (n < nbufs) { + // the dest buffer's offset has already been applied + memcpy (bufs[n], last, sizeof (Sample) * nframes); + ++n; + } + } else { + while (n < nbufs) { + memset (bufs[n], 0, sizeof (Sample) * nframes); + ++n; + } } }