again, drop the assert when asked to read part of an audio region with an invalid timeline range, and just send an error message. this avoids crashing when loading sessions created with the broken crossfade constructor

git-svn-id: svn://localhost/ardour2/branches/3.0@10260 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis
2011-10-20 21:24:06 +00:00
parent fb917cff45
commit 8b78439173

View File

@@ -400,9 +400,18 @@ AudioRegion::_read_at (const SourceList& srcs, framecnt_t limit,
internal_offset = 0;
buf_offset = _position - position;
/* if this fails then the requested section is entirely
before the position of this region
before the position of this region. An error in xfade
construction that was fixed in oct 2011 (rev 10259)
led to this being the case. We don't want to crash
when this error is encountered, so just settle
on displaying an error.
*/
assert (cnt >= buf_offset);
if (cnt < buf_offset) {
error << "trying to read region " << name() << " @ " << position << " which is outside region bounds "
<< _position << " .. " << last_frame() << " (len = " << length() << ')'
<< endmsg;
return 0; // read nothing
}
cnt -= buf_offset;
} else {
internal_offset = position - _position;