]> source.dussan.org Git - tigervnc.git/commitdiff
[Refactoring] Setting initial time offset in newFbsConnection().
authorConstantin Kaplinsky <const@tightvnc.com>
Thu, 19 Jun 2008 12:25:12 +0000 (12:25 +0000)
committerConstantin Kaplinsky <const@tightvnc.com>
Thu, 19 Jun 2008 12:25:12 +0000 (12:25 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2595 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/src/com/tightvnc/rfbplayer/RfbPlayer.java

index 8cff6e19d35a402ec1144bd45fa4a99d639f4de7..d2ae1c88304e61fc2984a78f220eb0fcb7806be1 100644 (file)
@@ -135,8 +135,7 @@ public class RfbPlayer extends java.applet.Applet
       } else {
         url = new URL(sessionURL);
       }
-      newFbsConnection();
-      fbs.setTimeOffset(initialTimeOffset);
+      newFbsConnection(initialTimeOffset);
       rfb = new RfbProto(fbs);
 
       vc = new VncCanvas(this);
@@ -195,8 +194,7 @@ public class RfbPlayer extends java.applet.Applet
             autoPlay = false;
           }
           fbs.close();
-          newFbsConnection();
-          fbs.setTimeOffset(newTimeOffset);
+          newFbsConnection(newTimeOffset);
           rfb.newSession(fbs);
           vc.updateFramebufferSize();
         } catch (NullPointerException e) {
@@ -218,11 +216,14 @@ public class RfbPlayer extends java.applet.Applet
    * Open new connection specified by this.url, save new FbsInputStream in
    * this.fbs.
    *
+   * @param timeOffset set this as current time position in the newly created
+   *   FbsInputStream object.
    * @throws java.io.IOException
    */
-  void newFbsConnection() throws IOException {
+  void newFbsConnection(long timeOffset) throws IOException {
     URLConnection connection = url.openConnection();
     fbs = new FbsInputStream(connection.getInputStream());
+    fbs.setTimeOffset(timeOffset);
   }
 
   public void setPausedInt(String paused) {