From 3f762d5d0bfcc4b8c758e885972d4dffaa105884 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Fri, 3 Aug 2007 22:15:50 +0200 Subject: [PATCH] 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 96809307849..d1541191273 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 355fc2c6ec8..3e75275cdb0 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);