diff options
author | Robin Gareus <robin@gareus.org> | 2017-07-27 17:50:27 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-07-27 17:50:52 +0200 |
commit | d67056562b9dcc244e8e2c59877c8cfcc9ab49a8 (patch) | |
tree | f71778d712295ee7365f670b45ec34ecaae77eb1 | |
parent | 68cd64394687b2ac8f6db73df152caf4450397a6 (diff) |
Fix write-pass re-start while in an active write-pass
-rw-r--r-- | libs/evoral/src/ControlList.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp index 801d8562c4..8d0ac688e9 100644 --- a/libs/evoral/src/ControlList.cpp +++ b/libs/evoral/src/ControlList.cpp @@ -467,6 +467,20 @@ ControlList::start_write_pass (double when) */ unlocked_invalidate_insert_iterator (); + + /* except if we're already in an active write-pass. + * + * invalid iterator == end() the iterator is set to the correct + * position in ControlList::add IFF (_in_write_pass && new_write_pass) + */ + if (_in_write_pass && !new_write_pass) { +#if 1 + add_guard_point (when, 0); // also sets most_recent_insert_iterator +#else + const ControlEvent cp (when, 0.0); + most_recent_insert_iterator = lower_bound (_events.begin(), _events.end(), &cp, time_comparator); +#endif + } } void |