[WDMAUD.DRV]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Sun, 17 Oct 2010 22:38:34 +0000 (22:38 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Sun, 17 Oct 2010 22:38:34 +0000 (22:38 +0000)
- 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

index d569d0b..cce93e8 100644 (file)
@@ -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,