From cae74309a583c29dd6cc2081425c2e7b673ea13e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 22 Nov 2014 00:44:48 -0500 Subject: Fix assert failure in control list interpolation. How we never hit this before is beyond me, it's in some ooooold code. --- libs/evoral/src/ControlList.cpp | 7 +++---- 1 file 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; -- cgit v1.2.3