Commit 5ecb8197 authored by Sven Baars's avatar Sven Baars Committed by Alexandre Julliard

winmm: Pass the device to WINMM_Pause directly.

parent 290f0fd3
...@@ -1966,27 +1966,20 @@ static MMRESULT WINMM_BeginPlaying(WINMM_Device *device) ...@@ -1966,27 +1966,20 @@ static MMRESULT WINMM_BeginPlaying(WINMM_Device *device)
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
static LRESULT WINMM_Pause(HWAVE hwave) static LRESULT WINMM_Pause(WINMM_Device *device)
{ {
WINMM_Device *device = WINMM_GetDeviceFromHWAVE(hwave);
HRESULT hr; HRESULT hr;
TRACE("(%p)\n", hwave); TRACE("(%p)\n", device->handle);
if(!WINMM_ValidateAndLock(device))
return MMSYSERR_INVALHANDLE;
hr = IAudioClient_Stop(device->client); hr = IAudioClient_Stop(device->client);
if(FAILED(hr)){ if(FAILED(hr)){
LeaveCriticalSection(&device->lock);
WARN("Stop failed: %08x\n", hr); WARN("Stop failed: %08x\n", hr);
return MMSYSERR_ERROR; return MMSYSERR_ERROR;
} }
device->stopped = FALSE; device->stopped = FALSE;
LeaveCriticalSection(&device->lock);
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
...@@ -2939,9 +2932,21 @@ UINT WINAPI waveOutBreakLoop(HWAVEOUT hWaveOut) ...@@ -2939,9 +2932,21 @@ UINT WINAPI waveOutBreakLoop(HWAVEOUT hWaveOut)
*/ */
UINT WINAPI waveOutPause(HWAVEOUT hWaveOut) UINT WINAPI waveOutPause(HWAVEOUT hWaveOut)
{ {
WINMM_Device *device;
MMRESULT mr;
TRACE("(%p)\n", hWaveOut); TRACE("(%p)\n", hWaveOut);
return WINMM_Pause((HWAVE)hWaveOut); device = WINMM_GetDeviceFromHWAVE((HWAVE)hWaveOut);
if(!WINMM_ValidateAndLock(device))
return MMSYSERR_INVALHANDLE;
mr = WINMM_Pause(device);
LeaveCriticalSection(&device->lock);
return mr;
} }
/************************************************************************** /**************************************************************************
...@@ -3573,7 +3578,7 @@ UINT WINAPI waveInStop(HWAVEIN hWaveIn) ...@@ -3573,7 +3578,7 @@ UINT WINAPI waveInStop(HWAVEIN hWaveIn)
if(!WINMM_ValidateAndLock(device)) if(!WINMM_ValidateAndLock(device))
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
hr = WINMM_Pause((HWAVE)hWaveIn); hr = WINMM_Pause(device);
if(FAILED(hr)){ if(FAILED(hr)){
LeaveCriticalSection(&device->lock); LeaveCriticalSection(&device->lock);
return MMSYSERR_ERROR; return MMSYSERR_ERROR;
......
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