Maarten Lankhorst : dsound: Sound acceleration fixes.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 6 08:03:45 CDT 2007


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

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Fri Aug  3 22:15:50 2007 +0200

dsound: Sound acceleration fixes.

---

 dlls/dsound/dsound.c  |   10 ++++------
 dlls/dsound/primary.c |    6 ++----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
index 9680930..d154119 100644
--- a/dlls/dsound/dsound.c
+++ b/dlls/dsound/dsound.c
@@ -1411,13 +1411,11 @@ HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGUID lpcG
 
     *ppDevice = device;
     device->guid = devGUID;
+    device->driver = NULL;
 
     /* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */
-    waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&device->driver, 0);
-
-    /* Disable the direct sound driver to force emulation if requested. */
-    if (ds_hw_accel == DS_HW_ACCEL_EMULATION)
-        device->driver = NULL;
+    if (ds_hw_accel > DS_HW_ACCEL_EMULATION)
+        waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&device->driver, 0);
 
     /* Get driver description */
     if (device->driver) {
@@ -1441,7 +1439,7 @@ HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGUID lpcG
         DWORD flags = CALLBACK_FUNCTION;
 
         /* disable direct sound if requested */
-        if (ds_hw_accel != DS_HW_ACCEL_EMULATION)
+        if (device->driver)
             flags |= WAVE_DIRECTSOUND;
 
         hr = mmErr(waveOutOpen(&(device->hwo),
diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c
index 355fc2c..3e75275 100644
--- a/dlls/dsound/primary.c
+++ b/dlls/dsound/primary.c
@@ -290,9 +290,7 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device)
 	if (device->hwbuf) {
 		err = IDsDriverBuffer_Stop(device->hwbuf);
 		if (err == DSERR_BUFFERLOST) {
-			DWORD flags = CALLBACK_FUNCTION;
-			if (ds_hw_accel != DS_HW_ACCEL_EMULATION)
-				flags |= WAVE_DIRECTSOUND;
+			DWORD flags = CALLBACK_FUNCTION | WAVE_DIRECTSOUND;
 			/* Wine-only: the driver wants us to reopen the device */
 			/* FIXME: check for errors */
 			IDsDriverBuffer_Release(device->hwbuf);
@@ -415,7 +413,7 @@ HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex)
 
 	if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMSETFORMAT) {
 		DWORD flags = CALLBACK_FUNCTION;
-		if (ds_hw_accel != DS_HW_ACCEL_EMULATION)
+		if (device->driver)
 			flags |= WAVE_DIRECTSOUND;
 		/* FIXME: check for errors */
 		DSOUND_PrimaryClose(device);




More information about the wine-cvs mailing list