[Refactoring] Setting initial time offset in newFbsConnection().
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2595 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/java/src/com/tightvnc/rfbplayer/RfbPlayer.java b/java/src/com/tightvnc/rfbplayer/RfbPlayer.java
index 8cff6e1..d2ae1c8 100644
--- a/java/src/com/tightvnc/rfbplayer/RfbPlayer.java
+++ b/java/src/com/tightvnc/rfbplayer/RfbPlayer.java
@@ -135,8 +135,7 @@
} else {
url = new URL(sessionURL);
}
- newFbsConnection();
- fbs.setTimeOffset(initialTimeOffset);
+ newFbsConnection(initialTimeOffset);
rfb = new RfbProto(fbs);
vc = new VncCanvas(this);
@@ -195,8 +194,7 @@
autoPlay = false;
}
fbs.close();
- newFbsConnection();
- fbs.setTimeOffset(newTimeOffset);
+ newFbsConnection(newTimeOffset);
rfb.newSession(fbs);
vc.updateFramebufferSize();
} catch (NullPointerException e) {
@@ -218,11 +216,14 @@
* 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) {