winmm: PlaySound SND_ASYNC fix
vrodic at gmail.com
Mon May 28 09:38:29 CDT 2007
Hi, this patch is still not applied though I've submitted it last
Wednesday. I guess it's not obviously clear that it is correct, so I'm
asking for a review here. I've peronally tested it with alsa and oss
sound backends. It specifically fixes one series of Croatian child
educational games named "Suncica".
Applications expect PlaySound() not to block when called with
SND_ASYNC flag. However, if a sound is currently playing, there is a
real chance of PlaySound() blocking for up to 1/3 of a second (size of
the playsound buffer), because of a sound buffer waiting to be played.
This patch adds a hWave field in the WINE_PLAYSOUND internal struct in
winemm.h so that MULTIMEDIA_PlaySound() function can call waveOutReset
when a sound is already playing to quickly remove it from the sound
system. Another scenario is when application wants to quickly stop a
currently playing sound at a specific time. Blocking behaviour isn't
necessarily a problem for such applications, but playing the sound for
additional 300 miliseconds could be.
Vedran Rodic <vrodic at gmail.com>
- fix PlaySound so it doesn't block when another sound is already playing.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1396 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20070528/a8dad540/playsound.bin
More information about the wine-devel