For videos that are longer than 240 frames, we anticipate

that the graphical precision of the seeking slider is not
enough to seek to individual frames on purpose. So we filter
the requested seeking position to keyframes if there is a
video track. The difference in snappiness when seeking is
like night and day.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38439 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2010-08-30 09:52:32 +00:00
parent 7516d989b1
commit 21f2531ebc
+6 -2
View File
@@ -712,8 +712,12 @@ Controller::SetFramePosition(int32 value)
{
BAutolock _(this);
int32 seekFrame = max_c(0, min_c(Duration(), value));
int32 currentFrame = CurrentFrame();
int64 seekFrame = max_c(0, min_c(Duration(), value));
int64 currentFrame = CurrentFrame();
// Snap to video keyframe, since that will be the fastest
// to display and seeking will feel more snappy.
if (Duration() > 240 && fVideoTrackSupplier != NULL)
fVideoTrackSupplier->FindKeyFrameForFrame(&seekFrame);
if (seekFrame != currentFrame) {
fSeekFrame = seekFrame;
fSeekRequested = true;