From e0fd2da47ef75ffb31308199f47c971cfd2c18c7 Mon Sep 17 00:00:00 2001 From: Constantin Kaplinsky Date: Mon, 23 Jun 2008 13:57:37 +0000 Subject: [PATCH] [Bugfix] Fixed a problem with recursive seeking and unhandled EOFException("[JUMP]"). git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2622 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- java/src/com/tightvnc/rfbplayer/FbsConnection.java | 2 +- java/src/com/tightvnc/rfbplayer/FbsInputStream.java | 10 ++++++---- java/src/com/tightvnc/rfbplayer/RfbPlayer.java | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/java/src/com/tightvnc/rfbplayer/FbsConnection.java b/java/src/com/tightvnc/rfbplayer/FbsConnection.java index b47ea56f..5bbf4e0c 100644 --- a/java/src/com/tightvnc/rfbplayer/FbsConnection.java +++ b/java/src/com/tightvnc/rfbplayer/FbsConnection.java @@ -92,7 +92,7 @@ public class FbsConnection { } // Seek to the specified position. - fbs.setTimeOffset(timeOffset); + fbs.setTimeOffset(timeOffset, false); return fbs; } diff --git a/java/src/com/tightvnc/rfbplayer/FbsInputStream.java b/java/src/com/tightvnc/rfbplayer/FbsInputStream.java index 2077bc5a..f5f4b391 100644 --- a/java/src/com/tightvnc/rfbplayer/FbsInputStream.java +++ b/java/src/com/tightvnc/rfbplayer/FbsInputStream.java @@ -167,11 +167,13 @@ class FbsInputStream extends InputStream { return (long)(off * playbackSpeed); } - public synchronized void setTimeOffset(long pos) { + public synchronized void setTimeOffset(long pos, boolean allowJump) { seekOffset = (long)(pos / playbackSpeed); - long minJumpForwardOffset = timeOffset + (long)(10000 / playbackSpeed); - if (seekOffset < timeOffset || seekOffset > minJumpForwardOffset) { - farSeeking = true; + if (allowJump) { + long minJumpForwardOffset = timeOffset + (long)(10000 / playbackSpeed); + if (seekOffset < timeOffset || seekOffset > minJumpForwardOffset) { + farSeeking = true; + } } notify(); } diff --git a/java/src/com/tightvnc/rfbplayer/RfbPlayer.java b/java/src/com/tightvnc/rfbplayer/RfbPlayer.java index 6cdd386f..e696d95f 100644 --- a/java/src/com/tightvnc/rfbplayer/RfbPlayer.java +++ b/java/src/com/tightvnc/rfbplayer/RfbPlayer.java @@ -256,7 +256,7 @@ public class RfbPlayer extends java.applet.Applet } public void setPos(long pos) { - fbs.setTimeOffset(pos); + fbs.setTimeOffset(pos, true); } public void updatePos() { -- 2.39.5