Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7564a641
Commit
7564a641
authored
Jan 22, 1993
by
Sjoerd Mullender
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Found and fixed a few bugs in the handling of audio files with MARKs.
parent
eeabe7eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
Lib/aifc.py
Lib/aifc.py
+8
-12
No files found.
Lib/aifc.py
View file @
7564a641
...
...
@@ -377,12 +377,9 @@ class Aifc_read():
else
:
raise
Error
,
'not an AIFF or AIFF-C file'
self
.
_comm_chunk_read
=
0
while
1
:
while
formlength
>
0
:
self
.
_ssnd_seek_needed
=
1
try
:
chunk
=
Chunk
().
init
(
self
.
_file
)
except
EOFError
:
raise
Error
,
'COMM chunk and/or SSND chunk missing'
chunk
=
Chunk
().
init
(
self
.
_file
)
formlength
=
formlength
-
8
-
chunk
.
chunksize
if
chunk
.
chunksize
&
1
:
formlength
=
formlength
-
1
...
...
@@ -393,10 +390,6 @@ class Aifc_read():
self
.
_ssnd_chunk
=
chunk
dummy
=
chunk
.
read
(
8
)
self
.
_ssnd_seek_needed
=
0
if
formlength
<=
0
:
if
not
self
.
_comm_chunk_read
:
raise
Error
,
'COMM chunk missing'
break
elif
chunk
.
chunkname
==
'FVER'
:
self
.
_version
=
_read_long
(
chunk
)
elif
chunk
.
chunkname
==
'MARK'
:
...
...
@@ -406,6 +399,8 @@ class Aifc_read():
else
:
raise
Error
,
'unrecognized chunk type '
+
chunk
.
chunkname
chunk
.
skip
()
if
not
self
.
_comm_chunk_read
or
not
self
.
_ssnd_chunk
:
raise
Error
,
'COMM chunk and/or SSND chunk missing'
if
self
.
_aifc
and
self
.
_decomp
:
params
=
[
CL
.
ORIGINAL_FORMAT
,
0
,
\
CL
.
BITS_PER_COMPONENT
,
0
,
\
...
...
@@ -707,7 +702,7 @@ class Aifc_write():
return
self
.
_nchannels
,
self
.
_sampwidth
,
self
.
_framerate
,
\
self
.
_nframes
,
self
.
_comptype
,
self
.
_compname
def
setmark
(
self
,
(
id
,
pos
,
name
)
):
def
setmark
(
self
,
id
,
pos
,
name
):
if
id
<=
0
:
raise
Error
,
'marker ID must be > 0'
if
pos
<
0
:
...
...
@@ -863,7 +858,8 @@ class Aifc_write():
else
:
datalength
=
self
.
_datawritten
if
datalength
==
self
.
_datalength
and
\
self
.
_nframes
==
self
.
_nframeswritten
:
self
.
_nframes
==
self
.
_nframeswritten
and
\
self
.
_marklength
==
0
:
self
.
_file
.
seek
(
curpos
,
0
)
return
self
.
_file
.
seek
(
self
.
_form_length_pos
,
0
)
...
...
@@ -888,7 +884,7 @@ class Aifc_write():
length
=
length
+
1
_write_long
(
self
.
_file
,
length
)
self
.
_marklength
=
length
+
8
_write_short
(
len
(
self
.
_file
,
markers
))
_write_short
(
self
.
_file
,
len
(
self
.
_
markers
))
for
marker
in
self
.
_markers
:
id
,
pos
,
name
=
marker
_write_short
(
self
.
_file
,
id
)
...
...
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