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
7f9c469f
Commit
7f9c469f
authored
Oct 12, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19131: The aifc module now correctly reads and writes sampwidth of
compressed streams.
parent
7eeebb89
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
Lib/aifc.py
Lib/aifc.py
+5
-4
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/aifc.py
View file @
7f9c469f
...
@@ -457,15 +457,13 @@ class Aifc_read:
...
@@ -457,15 +457,13 @@ class Aifc_read:
if
self
.
_comptype
!=
b'NONE'
:
if
self
.
_comptype
!=
b'NONE'
:
if
self
.
_comptype
==
b'G722'
:
if
self
.
_comptype
==
b'G722'
:
self
.
_convert
=
self
.
_adpcm2lin
self
.
_convert
=
self
.
_adpcm2lin
self
.
_framesize
=
self
.
_framesize
//
4
elif
self
.
_comptype
in
(
b'ulaw'
,
b'ULAW'
):
elif
self
.
_comptype
in
(
b'ulaw'
,
b'ULAW'
):
self
.
_convert
=
self
.
_ulaw2lin
self
.
_convert
=
self
.
_ulaw2lin
self
.
_framesize
=
self
.
_framesize
//
2
elif
self
.
_comptype
in
(
b'alaw'
,
b'ALAW'
):
elif
self
.
_comptype
in
(
b'alaw'
,
b'ALAW'
):
self
.
_convert
=
self
.
_alaw2lin
self
.
_convert
=
self
.
_alaw2lin
self
.
_framesize
=
self
.
_framesize
//
2
else
:
else
:
raise
Error
(
'unsupported compression type'
)
raise
Error
(
'unsupported compression type'
)
self
.
_sampwidth
=
2
else
:
else
:
self
.
_comptype
=
b'NONE'
self
.
_comptype
=
b'NONE'
self
.
_compname
=
b'not compressed'
self
.
_compname
=
b'not compressed'
...
@@ -787,7 +785,10 @@ class Aifc_write:
...
@@ -787,7 +785,10 @@ class Aifc_write:
_write_short
(
self
.
_file
,
self
.
_nchannels
)
_write_short
(
self
.
_file
,
self
.
_nchannels
)
self
.
_nframes_pos
=
self
.
_file
.
tell
()
self
.
_nframes_pos
=
self
.
_file
.
tell
()
_write_ulong
(
self
.
_file
,
self
.
_nframes
)
_write_ulong
(
self
.
_file
,
self
.
_nframes
)
_write_short
(
self
.
_file
,
self
.
_sampwidth
*
8
)
if
self
.
_comptype
in
(
b'ULAW'
,
b'ulaw'
,
b'ALAW'
,
b'alaw'
,
b'G722'
):
_write_short
(
self
.
_file
,
8
)
else
:
_write_short
(
self
.
_file
,
self
.
_sampwidth
*
8
)
_write_float
(
self
.
_file
,
self
.
_framerate
)
_write_float
(
self
.
_file
,
self
.
_framerate
)
if
self
.
_aifc
:
if
self
.
_aifc
:
self
.
_file
.
write
(
self
.
_comptype
)
self
.
_file
.
write
(
self
.
_comptype
)
...
...
Misc/NEWS
View file @
7f9c469f
...
@@ -76,6 +76,9 @@ Core and Builtins
...
@@ -76,6 +76,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #19131: The aifc module now correctly reads and writes sampwidth of
compressed streams.
- Issue #19158: a rare race in BoundedSemaphore could allow .release() too
- Issue #19158: a rare race in BoundedSemaphore could allow .release() too
often.
often.
...
...
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