Commit 362e39a4 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

winmm: Don't process audio data during waveOutWrite while playing.

parent bf65b96b
......@@ -1640,7 +1640,6 @@ static void CALLBACK test_reentrant_callback_func(HWAVEOUT hwo, UINT uMsg,
case WOM_DONE:
/* verify that WOM_DONE is not sent during the following waveOutWrite */
todo_wine_if(wom_done_count == 1)
ok(g_tid == 0, "callback called reentrantly\n");
g_tid = GetCurrentThreadId();
......
......@@ -191,6 +191,7 @@ static LRESULT WOD_Close(HWAVEOUT hwave);
static LRESULT WID_Open(WINMM_OpenInfo *info);
static LRESULT WID_Close(HWAVEIN hwave);
static MMRESULT WINMM_BeginPlaying(WINMM_Device *device);
static void WOD_PushData(WINMM_Device *device);
void WINMM_DeleteWaveform(void)
{
......@@ -775,8 +776,11 @@ static HRESULT reroute_mapper_device(WINMM_Device *device, BOOL is_out)
HeapFree(GetProcessHeap(), 0, info.format);
if(!stopped)
if(!stopped){
if(is_out)
WOD_PushData(device);
WINMM_BeginPlaying(device);
}
LeaveCriticalSection(&device->lock);
......@@ -1948,10 +1952,6 @@ 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){
device->stopped = FALSE;
......@@ -2893,6 +2893,9 @@ UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, WAVEHDR *header, UINT uSize)
header->dwFlags &= ~WHDR_DONE;
header->dwFlags |= WHDR_INQUEUE;
if(device->stopped)
WOD_PushData(device);
mr = WINMM_BeginPlaying(device);
LeaveCriticalSection(&device->lock);
......@@ -2970,6 +2973,9 @@ UINT WINAPI waveOutRestart(HWAVEOUT hWaveOut)
device->stopped = TRUE;
if(device->render)
WOD_PushData(device);
mr = WINMM_BeginPlaying(device);
LeaveCriticalSection(&device->lock);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment