Fix bug where seeking to the next keyframe would actually seek to the keyframe after the next keyframe

Originally committed to SVN as r6030.
This commit is contained in:
Thomas Goyne 2011-12-22 21:14:15 +00:00
parent 95fe6a523f
commit bf7e4d5cc1

View file

@ -381,8 +381,7 @@ struct video_frame_next_keyframe : public validator_video_loaded {
void operator()(agi::Context *c) {
std::vector<int> const& kf = c->videoController->GetKeyFrames();
std::vector<int>::const_iterator pos = lower_bound(kf.begin(), kf.end(), c->videoController->GetFrameN());
if (pos != kf.end()) ++pos;
std::vector<int>::const_iterator pos = lower_bound(kf.begin(), kf.end(), c->videoController->GetFrameN() + 1);
c->videoController->JumpToFrame(pos == kf.end() ? c->videoController->GetFrameN() - 1 : *pos);
}