VFile: The Entry-Indigo trick doesn't work on 4.0.1 hosts.
VFile: RandomVinFile can now write the cache to the file.
Vinfo: use the cached index if present and print a message whether it's there.
diff --git a/Demo/sgi/video/Vinfo.py b/Demo/sgi/video/Vinfo.py
index cfda32a..cf89a8d 100755
--- a/Demo/sgi/video/Vinfo.py
+++ b/Demo/sgi/video/Vinfo.py
@@ -54,7 +54,7 @@
def process(filename):
try:
- vin = VFile.VinFile().init(filename)
+ vin = VFile.RandomVinFile().init(filename)
except IOError, msg:
sys.stderr.write(filename + ': I/O error: ' + `msg` + '\n')
return 1
@@ -71,6 +71,12 @@
vin.close()
return
+ try:
+ vin.readcache()
+ print '[Using cached index]'
+ except VFile.Error:
+ print '[Constructing index on the fly]'
+
if not short:
if delta:
print 'Frame time deltas:',
@@ -83,11 +89,12 @@
datasize = 0
while 1:
try:
- t, data, cdata = vin.getnextframe()
+ t, ds, cs = vin.getnextframeheader()
+ vin.skipnextframedata(ds, cs)
except EOFError:
break
- datasize = datasize + len(data)
- if cdata: datasize = datasize + len(cdata)
+ datasize = datasize + ds
+ if cs: datasize = datasize + cs
if not short:
if n%8 == 0:
sys.stdout.write('\n')