13
0

Fix off-by-one in body_range().

git-svn-id: svn://localhost/ardour2/branches/3.0@12635 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-06-09 21:06:45 +00:00
parent 2492b43b56
commit d00e4589d0

View File

@ -623,7 +623,6 @@ AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
if (opaque()) { if (opaque()) {
if (_inverse_fade_in) { if (_inverse_fade_in) {
/* explicit inverse fade in curve (e.g. for constant /* explicit inverse fade in curve (e.g. for constant
* power), so we have to fetch it. * power), so we have to fetch it.
*/ */
@ -655,7 +654,6 @@ AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
_fade_in->curve().get_vector (internal_offset, internal_offset + fade_in_limit, gain_buffer, fade_in_limit); _fade_in->curve().get_vector (internal_offset, internal_offset + fade_in_limit, gain_buffer, fade_in_limit);
} }
/* Mix our newly-read data in, with the fade */ /* Mix our newly-read data in, with the fade */
for (framecnt_t n = 0; n < fade_in_limit; ++n) { for (framecnt_t n = 0; n < fade_in_limit; ++n) {
buf[n] += mixdown_buffer[n] * gain_buffer[n]; buf[n] += mixdown_buffer[n] * gain_buffer[n];
@ -1831,7 +1829,7 @@ AudioRegion::find_silence (Sample threshold, framecnt_t min_length, InterThreadI
Evoral::Range<framepos_t> Evoral::Range<framepos_t>
AudioRegion::body_range () const AudioRegion::body_range () const
{ {
return Evoral::Range<framepos_t> (first_frame() + _fade_in->back()->when, last_frame() - _fade_out->back()->when); return Evoral::Range<framepos_t> (first_frame() + _fade_in->back()->when + 1, last_frame() - _fade_out->back()->when);
} }
void void