diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-09-21 17:50:18 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-09-21 17:50:18 +0000 |
commit | 09231489bd280943eaac851a6c621af0405c2f30 (patch) | |
tree | 1d106b22a8514d25e4a988ce37bb7b9165ea1b9d | |
parent | 29a3ff4aa267e8eee6e437bf3a1842a3a2beeeae (diff) |
first part of colinf's patch for bogus xfades. this merely treats symptoms, not causes, but its application seems like the expedient and sensible thing to do for now
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@10111 d708f5d6-7413-0410-9779-e7cbd77b26cf
-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 8340b8bf6f..cdc7644aa2 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -302,6 +302,20 @@ Crossfade::read_at (Sample *buf, Sample *mixdown_buffer, } + /* + * Sometimes a Crossfade is created that doesn't correspont to a real + * overlap between regions. Obviously this shouldn't happen, but + * somehow it does, so check here that the crossfade lies within both + * the _in and _out regions to avoid read_at() below going crazy. + */ + + if (_out->coverage(start, start+to_write-1) == OverlapNone) { + return 0; + } + if (_in->coverage(start, start+to_write-1) == OverlapNone) { + return 0; + } + offset = start - _position; /* Prevent data from piling up inthe crossfade buffers when reading a transparent region */ |