From e45caad69798f2e7dbbc2d2371de74d20719efd6 Mon Sep 17 00:00:00 2001
From: Oswald Auguste de Bruin <oswald.de.bruin@ddvtech.com>
Date: Wed, 10 Jul 2013 15:00:31 +0200
Subject: [PATCH] Player optimisation

---
 src/buffer/player.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/buffer/player.cpp b/src/buffer/player.cpp
index e6f2297e..6ea3d757 100644
--- a/src/buffer/player.cpp
+++ b/src/buffer/player.cpp
@@ -171,6 +171,7 @@ int main(int argc, char** argv){
               int ms = JSON::Value(in_out.Received().get().substr(2)).asInt();
               bool ret = source.seek_time(ms);
               lasttime = 0;
+              lastTime = 0;
               break;
             }
             case 'p': { //play
@@ -238,8 +239,8 @@ int main(int argc, char** argv){
       if (lastTime == 0){
         lastTime = now - source.getJSON()["time"].asInt();
       }
-      if (playing == -1 && playUntil == 0 && source.getJSON()["time"].asInt() > now - lastTime + 2500){
-        std::cerr << (source.getJSON()["time"].asInt() - (now - lastTime)) << " sleepytimes" << std::endl;
+      if (playing == -1 && playUntil == 0 && source.getJSON()["time"].asInt() > now - lastTime + 1000){
+        //std::cerr << (source.getJSON()["time"].asInt() - (now - lastTime)) << " ms sleep" << std::endl;
         Util::sleep(source.getJSON()["time"].asInt() - (now - lastTime));
       }
       if ( playUntil && playUntil < source.getJSON()["time"].asInt()){