Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Small fixes for keyframe seek

parent 78699ebf
......@@ -137,7 +137,7 @@ void KeyframeView::slotGoToNext()
auto next = m_model->getNextKeyframe(GenTime(m_position + offset, pCore->getCurrentFps()), &ok);
if (ok) {
emit seekToPos(next.first.frames(pCore->getCurrentFps()) - offset);
emit seekToPos(qMin(next.first.frames(pCore->getCurrentFps()) - offset, m_duration - 1));
} else {
// no keyframe after current position
emit seekToPos(m_duration - 1);
......@@ -155,7 +155,7 @@ void KeyframeView::slotGoToPrev()
auto prev = m_model->getPrevKeyframe(GenTime(m_position + offset, pCore->getCurrentFps()), &ok);
if (ok) {
emit seekToPos(prev.first.frames(pCore->getCurrentFps()) - offset);
emit seekToPos(qMax(0, prev.first.frames(pCore->getCurrentFps()) - offset));
} else {
// no keyframe after current position
emit seekToPos(m_duration);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment