Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
605909dc
Kaydet (Commit)
605909dc
authored
Ara 28, 1993
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rot out all uses of time.milli*().
Also change command line options to use seconds for all times.
üst
ca1c876d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
Vplay.py
Demo/sgi/video/Vplay.py
+17
-16
No files found.
Demo/sgi/video/Vplay.py
Dosyayı görüntüle @
605909dc
...
...
@@ -12,10 +12,10 @@ def help():
print
'-M magnify : magnify the image by the given factor'
print
'-d : write some debug stuff on stderr'
print
'-l : loop, playing the movie over and over again'
print
'-m delta : drop frames closer than delta
msec (default 0
)'
print
'-m delta : drop frames closer than delta
seconds (default 0.
)'
print
'-n : don
\'
t wait after each file'
print
'-q : quiet, no informative messages'
print
'-r delta : regenerate input time base delta
msec
apart'
print
'-r delta : regenerate input time base delta
seconds
apart'
print
'-s speed : speed change factor (default 1.0)'
print
'-t : use a 2nd thread for read-ahead'
print
'-x left : window offset from left of screen'
...
...
@@ -81,10 +81,10 @@ def main():
if
opt
==
'-M'
:
magnify
=
float
(
eval
(
arg
))
if
opt
==
'-d'
:
debug
=
debug
+
1
if
opt
==
'-l'
:
looping
=
1
if
opt
==
'-m'
:
mindelta
=
string
.
atoi
(
arg
)
if
opt
==
'-m'
:
mindelta
=
float
(
eval
(
arg
)
)
if
opt
==
'-n'
:
nowait
=
1
if
opt
==
'-q'
:
quiet
=
1
if
opt
==
'-r'
:
regen
=
string
.
atoi
(
arg
)
if
opt
==
'-r'
:
regen
=
float
(
eval
(
arg
)
)
if
opt
==
'-s'
:
try
:
speed
=
float
(
eval
(
arg
))
...
...
@@ -238,7 +238,7 @@ def playonce(vin):
thread
.
start_new_thread
(
read_ahead
,
(
vin
,
queue
,
stop
))
# Get the read-ahead thread going
while
queue
.
qsize
()
<
MAXSIZE
/
2
and
not
stop
:
time
.
millisleep
(
100
)
time
.
sleep
(
0.
100
)
tin
=
0
toffset
=
0
...
...
@@ -250,7 +250,7 @@ def playonce(vin):
nskipped
=
0
data
=
None
tlast
=
t0
=
time
.
millitimer
()
tlast
=
t0
=
time
.
time
()
while
1
:
if
gl
.
qtest
():
...
...
@@ -278,6 +278,7 @@ def playonce(vin):
tin
,
size
,
csize
=
vin
.
getnextframeheader
()
except
EOFError
:
break
tin
=
tin
*
0.001
nin
=
nin
+
1
if
tin
+
toffset
<
oldtin
:
print
'Fix reversed time:'
,
oldtin
,
'to'
,
tin
...
...
@@ -286,7 +287,7 @@ def playonce(vin):
oldtin
=
tin
if
regen
:
tout
=
nin
*
regen
else
:
tout
=
tin
tout
=
int
(
tout
/
speed
)
tout
=
tout
/
speed
if
tout
-
told
<
mindelta
:
nskipped
=
nskipped
+
1
if
not
threading
:
...
...
@@ -300,34 +301,34 @@ def playonce(vin):
if
not
quiet
:
print
'[incomplete last frame]'
break
now
=
time
.
millitimer
()
now
=
time
.
time
()
dt
=
(
tout
-
told
)
-
(
now
-
tlast
)
told
=
tout
if
debug
:
sys
.
stderr
.
write
(
`
dt/10
`
+
' '
)
if
debug
:
sys
.
stderr
.
write
(
`
round(dt, 3)
`
+
' '
)
if
dt
<
0
:
nlate
=
nlate
+
1
if
dt
>
0
:
time
.
milli
sleep
(
dt
)
now
=
now
+
dt
time
.
sleep
(
dt
)
now
=
time
.
time
()
tlast
=
now
vin
.
showframe
(
data
,
cdata
)
nout
=
nout
+
1
t1
=
time
.
millitimer
()
t1
=
time
.
time
()
if
debug
:
sys
.
stderr
.
write
(
'
\n
'
)
if
quiet
:
return
0
print
'Recorded:'
,
nin
,
'frames in'
,
tin
*
0.001
,
'sec.'
,
if
tin
:
print
'-- average'
,
int
(
nin
*
10000.0
/
tin
)
*
0.1
,
'frames/sec'
,
print
'Recorded:'
,
nin
,
'frames in'
,
round
(
tin
,
3
)
,
'sec.'
,
if
tin
:
print
'-- average'
,
round
(
nin
/
tin
,
1
)
,
'frames/sec'
,
print
if
nskipped
:
print
'Skipped'
,
nskipped
,
'frames'
tout
=
t1
-
t0
print
'Played:'
,
nout
,
print
'frames in'
,
tout
*
0.001
,
'sec.'
,
if
tout
:
print
'-- average'
,
int
(
nout
*
10000.0
/
tout
)
*
0.1
,
'frames/sec'
,
print
'frames in'
,
round
(
tout
,
3
)
,
'sec.'
,
if
tout
:
print
'-- average'
,
round
(
nout
/
tout
,
1
)
,
'frames/sec'
,
print
if
nlate
:
print
'There were'
,
nlate
,
'late frames'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment