summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_port.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/audio_port.cc')
-rw-r--r--libs/ardour/audio_port.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/ardour/audio_port.cc b/libs/ardour/audio_port.cc
index 99f2b7ecae..2250c7f2a7 100644
--- a/libs/ardour/audio_port.cc
+++ b/libs/ardour/audio_port.cc
@@ -44,7 +44,7 @@ AudioPort::reset()
if (_buffer.capacity() > 0) {
_buffer.clear();
}
- _silent = true;
+ assert(_buffer.silent());
}
_metering = 0;
@@ -55,8 +55,12 @@ void
AudioPort::cycle_start (jack_nframes_t nframes)
{
if (_flags & JackPortIsOutput) {
- // FIXME: do nothing, we can cache the value (but capacity needs to be set)
+ const bool silent = _buffer.silent();
+ // FIXME: do nothing, we can cache the value (but capacity needs to be set for MIDI)
_buffer.set_data((Sample*)jack_port_get_buffer (_port, nframes), nframes);
+ if (silent) {
+ _buffer.silence(nframes);
+ }
} else {
_buffer.set_data((Sample*)jack_port_get_buffer (_port, nframes), nframes);
}