playsound bug

Torbjörn Andersson torbjorn.e.andersson at tietoenator.com
Wed Oct 17 02:37:41 EDT 2001


There appears to be a bug in playsound's overflow handling in the 
callback function. As long as overflowBytes > 0 it will keep copying the 
same piece of the overflow buffer into the stream.

It can't be very common that the overflow handler comes into play, or 
we'd have noticed it long ago. My test case was the 8-bit mono WAV file 
"cuckoo.wav" from MindRover. Sound_Decode() got a 16KB buffer, so the 
audio callback played the first 4KB right away, and then the next 4KB 
three times until the overflow buffer was drained.

I think the included patch fixes it. Probably won't have any effect on 
the MP3 problem though.

Torbjörn Andersson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: playsound.diff.gz
Type: application/x-gzip
Size: 457 bytes
Desc: not available
URL: <http://icculus.org/pipermail/sdlsound/attachments/20011017/65ccc65d/attachment.gz>


More information about the sdlsound mailing list