Step back a bit when going from ffwd to play
authorMark Calderbank <mark@vomp.tv>
Sun, 11 Feb 2007 20:18:41 +0000 (20:18 +0000)
committerMark Calderbank <mark@vomp.tv>
Sun, 11 Feb 2007 20:18:41 +0000 (20:18 +0000)
player.cc

index ef2c0f94cd975385b567a16321bf9cb9907150c1..b47ef452c8fb78e5885a39df77fb4e5631195058 100644 (file)
--- a/player.cc
+++ b/player.cc
@@ -20,6 +20,8 @@
 
 #include "player.h"
 
+#define USER_RESPONSE_TIME 500 // Milliseconds
+
 // ----------------------------------- Called from outside, one offs or info funcs
 
 Player::Player(MessageQueue* tmessageQueue, void* tmessageReceiver, bool tIsRecording)
@@ -546,6 +548,11 @@ void Player::switchState(UCHAR toState, ULONG jumpFrame)
         case S_PLAY: // to S_PLAY
         {
           state = S_PLAY;
+          ULONG stepback = USER_RESPONSE_TIME * video->getFPS() * ifactor / 1000;
+          if (stepback < currentFrameNumber)
+            currentFrameNumber -= stepback;
+          else
+            currentFrameNumber = 0;
           restartAtFrame(currentFrameNumber);
           return;
         }