mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Fixed a bug where the library inadvertently skipped over the sound
data. Pass an extra parameter to the compression library.
This commit is contained in:
		
							parent
							
								
									3ad7fc70cc
								
							
						
					
					
						commit
						93f0740073
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -398,6 +398,7 @@ def initfp(self, file):
 | 
			
		|||
				pass
 | 
			
		||||
			else:
 | 
			
		||||
				raise Error, 'unrecognized chunk type '+chunk.chunkname
 | 
			
		||||
			if formlength > 0:
 | 
			
		||||
				chunk.skip()
 | 
			
		||||
		if not self._comm_chunk_read or not self._ssnd_chunk:
 | 
			
		||||
			raise Error, 'COMM chunk and/or SSND chunk missing'
 | 
			
		||||
| 
						 | 
				
			
			@ -500,7 +501,8 @@ def readframes(self, nframes):
 | 
			
		|||
				size = size / 2
 | 
			
		||||
		data = self._ssnd_chunk.read(size)
 | 
			
		||||
		if self._decomp and data:
 | 
			
		||||
			params = [CL.FRAME_BUFFER_SIZE, len(data) * 2]
 | 
			
		||||
			params = [CL.FRAME_BUFFER_SIZE, len(data) * 2, \
 | 
			
		||||
				  CL.COMPRESSED_BUFFER_SIZE, len(data)]
 | 
			
		||||
			self._decomp.SetParams(params)
 | 
			
		||||
			data = self._decomp.Decompress(len(data) / self._nchannels, data)
 | 
			
		||||
		self._soundpos = self._soundpos + len(data) / (self._nchannels * self._sampwidth)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue