summaryrefslogtreecommitdiff
path: root/drumgizmo/output/jackaudio.cc
diff options
context:
space:
mode:
Diffstat (limited to 'drumgizmo/output/jackaudio.cc')
-rw-r--r--drumgizmo/output/jackaudio.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/drumgizmo/output/jackaudio.cc b/drumgizmo/output/jackaudio.cc
index 2274bea..2620b84 100644
--- a/drumgizmo/output/jackaudio.cc
+++ b/drumgizmo/output/jackaudio.cc
@@ -26,6 +26,7 @@
*/
#include <cassert>
#include <iostream>
+#include <cstring>
#include "jackaudio.h"
@@ -83,6 +84,12 @@ void JackAudioOutputEngine::stop()
void JackAudioOutputEngine::pre(size_t nsamples)
{
+ // Clear all channels
+ for(auto& channel : channels)
+ {
+ assert(channel.samples.size() == nsamples);
+ std::memset(channel.samples.data(), 0, nsamples * sizeof(sample_t));
+ }
}
void JackAudioOutputEngine::run(int ch, sample_t* samples, size_t nsamples)