diff options
Diffstat (limited to 'libs/ardour/crossfade.cc')
-rw-r--r-- | libs/ardour/crossfade.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index 556f11125e..d45d5efa9f 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -294,6 +294,13 @@ Crossfade::read_at (Sample *buf, Sample *mixdown_buffer, offset = start - _position; + /* Prevent data from piling up inthe crossfade buffers when reading a transparent region */ + if (!(_out->opaque())) { + memset (crossfade_buffer_out, 0, sizeof (Sample) * to_write); + } else if (!(_in->opaque())) { + memset (crossfade_buffer_in, 0, sizeof (Sample) * to_write); + } + _out->read_at (crossfade_buffer_out, mixdown_buffer, gain_buffer, start, to_write, chan_n); _in->read_at (crossfade_buffer_in, mixdown_buffer, gain_buffer, start, to_write, chan_n); @@ -358,6 +365,13 @@ Crossfade::refresh () return false; } + /* Top layer shouldn't be transparent */ + + if (!((layer_relation > 0 ? _in : _out)->opaque())) { + Invalidated (shared_from_this()); + return false; + } + /* layer ordering cannot change */ int32_t new_layer_relation = (int32_t) (_in->layer() - _out->layer()); |