summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-22 00:44:48 -0500
committerDavid Robillard <d@drobilla.net>2014-11-22 00:46:15 -0500
commitcae74309a583c29dd6cc2081425c2e7b673ea13e (patch)
tree9b93419c01b7e3cd42ba042a55654a869d311048
parent01493b14cfa215c61e3a99e6d4687b6d37453ab6 (diff)
Fix assert failure in control list interpolation.
How we never hit this before is beyond me, it's in some ooooold code.
-rw-r--r--libs/evoral/src/ControlList.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp
index bc8626c535..2591cec58c 100644
--- a/libs/evoral/src/ControlList.cpp
+++ b/libs/evoral/src/ControlList.cpp
@@ -1423,9 +1423,10 @@ ControlList::rt_safe_earliest_event_linear_unlocked (double start, double& x, do
/* Move left of cache to this point
* (Optimize for immediate call this cycle within range) */
_search_cache.left = x;
- //++_search_cache.range.first;
- assert(x >= start);
return true;
+ } else if (next->when < start || (!inclusive && next->when == start)) {
+ /* "Next" is before the start, no points left. */
+ return false;
}
if (fabs(first->value - next->value) <= 1) {
@@ -1435,8 +1436,6 @@ ControlList::rt_safe_earliest_event_linear_unlocked (double start, double& x, do
/* Move left of cache to this point
* (Optimize for immediate call this cycle within range) */
_search_cache.left = x;
- //++_search_cache.range.first;
- assert(inclusive ? x >= start : x > start);
return true;
} else {
return false;