From 7c151f3f056cc3662ec37f822b9c1f548bce4d37 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Sun, 17 Oct 2010 22:38:34 +0000 Subject: [PATCH] [WDMAUD.DRV] - Kernel streaming pins need to transit states from Run -> Pause -> Acquire -> Stop. - Fixes SB Live playback hang on last tone when stopping playback svn path=/trunk/; revision=49191 --- reactos/dll/win32/wdmaud.drv/legacy.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/reactos/dll/win32/wdmaud.drv/legacy.c b/reactos/dll/win32/wdmaud.drv/legacy.c index d569d0ba00c..cce93e8994a 100644 --- a/reactos/dll/win32/wdmaud.drv/legacy.c +++ b/reactos/dll/win32/wdmaud.drv/legacy.c @@ -282,6 +282,25 @@ WdmAudCloseSoundDeviceByLegacy( /* First stop the stream */ if (DeviceType != MIXER_DEVICE_TYPE) { + DeviceInfo.u.State = KSSTATE_PAUSE; + SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_SETDEVICE_STATE, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + DeviceInfo.u.State = KSSTATE_ACQUIRE; + SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_SETDEVICE_STATE, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + DeviceInfo.u.State = KSSTATE_STOP; SyncOverlappedDeviceIoControl(KernelHandle, IOCTL_SETDEVICE_STATE,