diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-25 23:20:31 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-25 23:20:31 +0000 |
commit | 6a9758dbccf4cd60ec459c3ff24b082ac1851bd3 (patch) | |
tree | ae3e7c87f961d19631108b2c5ed6073a68cfe975 /libs/evoral | |
parent | 2794eab6ae08a22d8d99f2ee58dcc03771acfc51 (diff) |
Fix case where the working range for the interpolation can be chosen wrongly if start is after the cached point's time. Should fix #3356.
git-svn-id: svn://localhost/ardour2/branches/3.0@7495 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral')
-rw-r--r-- | libs/evoral/src/ControlList.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp index eeadadfb52..880198dc53 100644 --- a/libs/evoral/src/ControlList.cpp +++ b/libs/evoral/src/ControlList.cpp @@ -1007,8 +1007,7 @@ ControlList::rt_safe_earliest_event_discrete_unlocked (double start, double& x, bool ControlList::rt_safe_earliest_event_linear_unlocked (double start, double& x, double& y, bool inclusive) const { - //cerr << "earliest_event(start: " << start << ", end: " << end - //<< ", x: " << x << ", y: " << y << ", inclusive: " << inclusive << ")" << endl; + // cout << "earliest_event(start: " << start << ", x: " << x << ", y: " << y << ", inclusive: " << inclusive << ")" << endl; const_iterator length_check_iter = _events.begin(); if (_events.empty()) { // 0 events @@ -1026,9 +1025,13 @@ ControlList::rt_safe_earliest_event_linear_unlocked (double start, double& x, do const ControlEvent* next = NULL; /* Step is after first */ - if (_search_cache.first == _events.begin() || (*_search_cache.first)->when == start) { + if (_search_cache.first == _events.begin() || (*_search_cache.first)->when <= start) { first = *_search_cache.first; - next = *(++_search_cache.first); + ++_search_cache.first; + if (_search_cache.first == _events.end()) { + return false; + } + next = *_search_cache.first; /* Step is before first */ } else { |