DSOUND: buffer underrun & sound chunks left out

Jerry Ji JerryJz at hotmail.com
Sun Mar 16 10:10:56 CST 2003


This patch fix two problem:
1. the improper play position return by DSOUND_PrimaryGetPosition - beffer
underrun,
2. and the notify mechanics we used - sound data skipped.

Please refer to the comment for the first problem.

DSOUND_CheckEvent(IDirectSoundBufferImpl *dsb, int len) original use current
play position and the count of data TO BE played to check if a notify should
be generated. That's to say, an application may be notified before the data
at the desired offset really played. Since the application got the notify
that the data in it's demand region is useless (played), it might call
IDirectSoundBufferImpl_Lock to lock this region, which contains useful data,
IDirectSoundBufferImpl_Lock will handle the conflict by cancelling the
region by default.

NOTE:
There are still problems with DSBPN_OFFSETSTOP event. If the buffer's state
is STATE_STOPPED, my patch will set the event each time DSOUND_PerformMix
called by the timer! I know it's a bad idea, so if anyone have a better
solution, please re-patch it.

ChangeLog:
 - Fixed buffer underrun & sound chunks left out.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 5591 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20030317/0a044225/patch.obj


More information about the wine-patches mailing list