1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-21 02:17:08 +00:00

Completed initial non-trivial test, fixing revealed errors.

This commit is contained in:
Thomas Harte
2016-12-20 19:15:36 -05:00
parent 5a508ea0df
commit 823ab9bc34
2 changed files with 25 additions and 15 deletions
+4 -2
View File
@@ -94,8 +94,10 @@ void PCMPatchedTrack::insert_period(const Period &period)
right_period.push_start_to_time(period.end_time);
start_period->trim_end_to_time(period.start_time);
// the iterator isn't guaranteed to survive the insert, e.g. if it causes a resize
std::vector<Period>::difference_type offset = start_period - periods_.begin();
periods_.insert(start_period + 1, period);
periods_.insert(start_period + 2, right_period);
periods_.insert(periods_.begin() + offset + 2, right_period);
}
}
}
@@ -147,7 +149,7 @@ Track::Event PCMPatchedTrack::get_next_event()
else event = underlying_track_->get_next_event();
// see what time that gets us to. If it's still within the current period, return the found event
Time event_time = current_time_ + event.length;
Time event_time = current_time_ + event.length - period_error;
if(event_time < active_period_->end_time)
{
current_time_ = event_time;