X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Faudio_port.cc;h=ae64d797c9da5268d1a3c0b16e5f1b4697bfc8be;hb=ecae912da9f6805d4939e657e3a591f79b0ae542;hp=e01f4a89e6b58ef2a88ba22d959ac7442ff4d590;hpb=d155f32039570e9e0cde11b42e395ca2bcc89ffd;p=ardour.git diff --git a/libs/ardour/audio_port.cc b/libs/ardour/audio_port.cc index e01f4a89e6..ae64d797c9 100644 --- a/libs/ardour/audio_port.cc +++ b/libs/ardour/audio_port.cc @@ -53,13 +53,15 @@ AudioPort::cycle_start (pframes_t nframes) } void -AudioPort::cycle_end (pframes_t nframes) +AudioPort::cycle_end (pframes_t) { if (sends_output() && !_buffer->written()) { - /* we can't use nframes here because the current buffer capacity may + /* we can't use nframes here because the current buffer capacity may be shorter than the full buffer size if we split the cycle. */ - _buffer->silence (_buffer->capacity()); + if (_buffer->capacity () > 0) { + _buffer->silence (_buffer->capacity()); + } } } @@ -72,14 +74,10 @@ AudioBuffer& AudioPort::get_audio_buffer (pframes_t nframes) { /* caller must hold process lock */ - _buffer->set_data ((Sample *) jack_port_get_buffer (_jack_port, _cycle_nframes) + + _buffer->set_data ((Sample *) jack_port_get_buffer (_jack_port, _cycle_nframes) + _global_port_buffer_offset + _port_buffer_offset, nframes); return *_buffer; } -size_t -AudioPort::raw_buffer_size (pframes_t nframes) const -{ - return nframes * sizeof (Sample); -} +