cpython: fdbbbc7b40d7 (original) (raw)

Mercurial > cpython

changeset 85821:fdbbbc7b40d7 2.7

Issue #18950: Fix miscellaneous bugs in the sunau module. Au_read.readframes() now updates current file position and reads correct number of frames from multichannel stream. Au_write.writeframesraw() now correctly updates current file position. Au_read and Au_write now correctly work with file object if start file position is not a zero. [#18950]

Serhiy Storchaka storchaka@gmail.com
date Sat, 28 Sep 2013 21:31:36 +0300
parents b0866382064f
children 39bb7421cb69
files Lib/sunau.py Misc/NEWS
diffstat 2 files changed, 26 insertions(+), 5 deletions(-)[+] [-] Lib/sunau.py 25 Misc/NEWS 6

line wrap: on

line diff

--- a/Lib/sunau.py +++ b/Lib/sunau.py @@ -203,6 +203,10 @@ class Au_read: break else: self._info = ''

def getfp(self): return self._file @@ -255,7 +259,8 @@ class Au_read: if nframes == AUDIO_UNKNOWN_SIZE: data = self._file.read() else:

@@ -263,8 +268,10 @@ class Au_read: return None # XXX--not implemented yet def rewind(self):

def tell(self): return self._soundpos @@ -272,7 +279,9 @@ class Au_read: def setpos(self, pos): if pos < 0 or pos > self.getnframes(): raise Error, 'position not in range'

def close(self): @@ -382,10 +391,10 @@ class Au_write: def writeframesraw(self, data): self._ensure_header_written()

@@ -445,6 +454,10 @@ class Au_write: length = AUDIO_UNKNOWN_SIZE else: length = self._nframes * self._framesize

@@ -454,7 +467,9 @@ class Au_write: self._file.write('\0'*(header_size - len(self._info) - 24)) def _patchheader(self):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -32,6 +32,12 @@ Core and Builtins Library ------- +- Issue #18950: Fix miscellaneous bugs in the sunau module.