[haiku-commits] r38669 - haiku/trunk/src/apps/mediaplayer

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 16 Sep 2010 14:39:51 +0200 (CEST)

Author: stippi
Date: 2010-09-16 14:39:51 +0200 (Thu, 16 Sep 2010)
New Revision: 38669
Changeset: http://dev.haiku-os.org/changeset/38669

Modified:
   haiku/trunk/src/apps/mediaplayer/Controller.cpp
Log:
Only seek to keyframes when the difference in frames
is more than 5 frames.


Modified: haiku/trunk/src/apps/mediaplayer/Controller.cpp
===================================================================
--- haiku/trunk/src/apps/mediaplayer/Controller.cpp     2010-09-16 12:38:41 UTC 
(rev 38668)
+++ haiku/trunk/src/apps/mediaplayer/Controller.cpp     2010-09-16 12:39:51 UTC 
(rev 38669)
@@ -722,15 +722,18 @@
        fRequestedSeekFrame = max_c(0, min_c(_FrameDuration(), value));
        fSeekFrame = fRequestedSeekFrame;
 
+       int64 currentFrame = CurrentFrame();
+
        // Snap to a video keyframe, since that will be the fastest
        // to display and seeking will feel more snappy. Note that we
        // don't store this change in fSeekFrame, since we still want
        // to report the originally requested seek frame in TimePosition()
        // until we could reach that frame.
-       if (Duration() > 240 && fVideoTrackSupplier != NULL)
+       if (Duration() > 240 && fVideoTrackSupplier != NULL
+               && abs(value - currentFrame) > 5) {
                fVideoTrackSupplier->FindKeyFrameForFrame(&fSeekFrame);
+       }
 
-       int64 currentFrame = CurrentFrame();
 //printf("SetFramePosition(%lld) -> %lld (current: %lld, duration: %lld) "
 //"(video: %p)\n", value, fSeekFrame, currentFrame, _FrameDuration(),
 //fVideoTrackSupplier);


Other related posts:

  • » [haiku-commits] r38669 - haiku/trunk/src/apps/mediaplayer - superstippi