Maarten Lankhorst : dsound: Reset state when stopping device.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 30 16:52:29 CDT 2007


Module: wine
Branch: master
Commit: de9cecaaa86802ba105b1735721725fc08f557cd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=de9cecaaa86802ba105b1735721725fc08f557cd

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Sun Jul 29 21:04:09 2007 +0200

dsound: Reset state when stopping device.

---

 dlls/dsound/primary.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c
index 8edf477..16509d6 100644
--- a/dlls/dsound/primary.c
+++ b/dlls/dsound/primary.c
@@ -316,6 +316,13 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device)
 								  (LPVOID)&(device->hwbuf));
 				if (err != DS_OK)
 					WARN("IDsDriver_CreateSoundBuffer failed\n");
+				else if (device->state == STATE_STOPPING)
+					device->state = STATE_STOPPED;
+				else if (device->state == STATE_PLAYING)
+					device->state = STATE_STARTING;
+				if (err == DS_OK)
+					FillMemory(device->buffer, device->buflen, (device->pwfx->wBitsPerSample == 8) ? 128 : 0);
+
 			} else {
 				WARN("waveOutOpen failed\n");
 			}




More information about the wine-cvs mailing list