summaryrefslogtreecommitdiffstats
path: root/Demo/sgi/video/Vinfo.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-09-08 15:04:01 (GMT)
committerGuido van Rossum <guido@python.org>1992-09-08 15:04:01 (GMT)
commit269b2a2eb7c5d63bdfb7989a9c9626e8940aafd4 (patch)
treec45e4187c72c2293da62678ce276f81985975796 /Demo/sgi/video/Vinfo.py
parent3577113d8366d1c75cf2cbdbeb5168fd86d2834c (diff)
downloadcpython-269b2a2eb7c5d63bdfb7989a9c9626e8940aafd4.zip
cpython-269b2a2eb7c5d63bdfb7989a9c9626e8940aafd4.tar.gz
cpython-269b2a2eb7c5d63bdfb7989a9c9626e8940aafd4.tar.bz2
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.
Diffstat (limited to 'Demo/sgi/video/Vinfo.py')
-rwxr-xr-xDemo/sgi/video/Vinfo.py15
1 files changed, 11 insertions, 4 deletions
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 main():
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 @@ def process(filename):
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 @@ def process(filename):
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')