Only seek to keyframes when the difference in frames
is more than 5 frames. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38669 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -722,15 +722,18 @@ Controller::SetFramePosition(int64 value)
|
|||||||
fRequestedSeekFrame = max_c(0, min_c(_FrameDuration(), value));
|
fRequestedSeekFrame = max_c(0, min_c(_FrameDuration(), value));
|
||||||
fSeekFrame = fRequestedSeekFrame;
|
fSeekFrame = fRequestedSeekFrame;
|
||||||
|
|
||||||
|
int64 currentFrame = CurrentFrame();
|
||||||
|
|
||||||
// Snap to a video keyframe, since that will be the fastest
|
// Snap to a video keyframe, since that will be the fastest
|
||||||
// to display and seeking will feel more snappy. Note that we
|
// to display and seeking will feel more snappy. Note that we
|
||||||
// don't store this change in fSeekFrame, since we still want
|
// don't store this change in fSeekFrame, since we still want
|
||||||
// to report the originally requested seek frame in TimePosition()
|
// to report the originally requested seek frame in TimePosition()
|
||||||
// until we could reach that frame.
|
// until we could reach that frame.
|
||||||
if (Duration() > 240 && fVideoTrackSupplier != NULL)
|
if (Duration() > 240 && fVideoTrackSupplier != NULL
|
||||||
|
&& abs(value - currentFrame) > 5) {
|
||||||
fVideoTrackSupplier->FindKeyFrameForFrame(&fSeekFrame);
|
fVideoTrackSupplier->FindKeyFrameForFrame(&fSeekFrame);
|
||||||
|
}
|
||||||
|
|
||||||
int64 currentFrame = CurrentFrame();
|
|
||||||
//printf("SetFramePosition(%lld) -> %lld (current: %lld, duration: %lld) "
|
//printf("SetFramePosition(%lld) -> %lld (current: %lld, duration: %lld) "
|
||||||
//"(video: %p)\n", value, fSeekFrame, currentFrame, _FrameDuration(),
|
//"(video: %p)\n", value, fSeekFrame, currentFrame, _FrameDuration(),
|
||||||
//fVideoTrackSupplier);
|
//fVideoTrackSupplier);
|
||||||
|
|||||||
Reference in New Issue
Block a user