]> source.dussan.org Git - tigervnc.git/commitdiff
[Development] Print FBS entry point information when efficient seeking via index...
authorConstantin Kaplinsky <const@tightvnc.com>
Fri, 20 Jun 2008 12:57:37 +0000 (12:57 +0000)
committerConstantin Kaplinsky <const@tightvnc.com>
Fri, 20 Jun 2008 12:57:37 +0000 (12:57 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2607 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/src/com/tightvnc/rfbplayer/FbsConnection.java

index 093978593a51d68da0dcacfdca39411da8f9511d..23b0765942a791c77aa6d842f47f32aa719a4f70 100644 (file)
@@ -63,6 +63,21 @@ public class FbsConnection {
   }
 
   FbsInputStream connect(long timeOffset) throws IOException {
+    // Try efficient seeking first.
+    if (timeOffset > 0 && indexData != null && numIndexRecords > 0) {
+      int i = 0;
+      while (i < numIndexRecords && indexData[i].timestamp <= timeOffset) {
+        i++;
+      }
+      if (i > 0) {
+        FbsEntryPoint entryPoint = indexData[i - 1];
+        if (entryPoint.key_size < entryPoint.fbs_fpos) {
+          System.err.println(entryPoint);
+        }
+      }
+    }
+
+    // Playback/seek from the beginning.
     URLConnection connection = fbsURL.openConnection();
     FbsInputStream fbs = new FbsInputStream(connection.getInputStream());
     fbs.setTimeOffset(timeOffset);