[PATCH v3 2/2] winmm: Buffer any WOM_DONE/WIM_DATA events triggered from within a waveOut/waveIn callback.

Andrew Eikum aeikum at codeweavers.com
Mon Jan 24 14:56:23 CST 2022


On Fri, Jan 21, 2022 at 03:37:27PM +1100, Liam Murphy wrote:
> The events are then fired after the callback completes.
> 

I think a simpler way to solve this is to only process audio data
during waveOutWrite if the device is stopped, see below patch. This
should prevent us sending reentrant WOM_DONE messages.

Can you try it out and see if that fixes your game?

---
 dlls/winmm/waveform.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/winmm/waveform.c b/dlls/winmm/waveform.c
index 1159b48b483..2813f9a103f 100644
--- a/dlls/winmm/waveform.c
+++ b/dlls/winmm/waveform.c
@@ -1948,11 +1948,10 @@ static MMRESULT WINMM_BeginPlaying(WINMM_Device *device)
·
     TRACE("(%p)\n", device->handle);
·
-    if(device->render)
-        /* prebuffer data before starting */
-        WOD_PushData(device);
-
     if(device->stopped){
+        if(device->render)
+            WOD_PushData(device);
+
         device->stopped = FALSE;
·
         hr = IAudioClient_Start(device->client);
--·
2.34.1



More information about the wine-devel mailing list