dsound: Sound acceleration fixes.

This commit is contained in:
Maarten Lankhorst 2007-08-03 22:15:50 +02:00 committed by Alexandre Julliard
parent 4536a9d66d
commit 3f762d5d0b
2 changed files with 6 additions and 10 deletions

View File

@ -1411,13 +1411,11 @@ HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGUID lpcG
*ppDevice = device; *ppDevice = device;
device->guid = devGUID; device->guid = devGUID;
device->driver = NULL;
/* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */ /* DRV_QUERYDSOUNDIFACE is a "Wine extension" to get the DSound interface */
waveOutMessage((HWAVEOUT)wod, DRV_QUERYDSOUNDIFACE, (DWORD_PTR)&device->driver, 0); if (ds_hw_accel > DS_HW_ACCEL_EMULATION)
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;
/* Get driver description */ /* Get driver description */
if (device->driver) { if (device->driver) {
@ -1441,7 +1439,7 @@ HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGUID lpcG
DWORD flags = CALLBACK_FUNCTION; DWORD flags = CALLBACK_FUNCTION;
/* disable direct sound if requested */ /* disable direct sound if requested */
if (ds_hw_accel != DS_HW_ACCEL_EMULATION) if (device->driver)
flags |= WAVE_DIRECTSOUND; flags |= WAVE_DIRECTSOUND;
hr = mmErr(waveOutOpen(&(device->hwo), hr = mmErr(waveOutOpen(&(device->hwo),

View File

@ -290,9 +290,7 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device)
if (device->hwbuf) { if (device->hwbuf) {
err = IDsDriverBuffer_Stop(device->hwbuf); err = IDsDriverBuffer_Stop(device->hwbuf);
if (err == DSERR_BUFFERLOST) { if (err == DSERR_BUFFERLOST) {
DWORD flags = CALLBACK_FUNCTION; DWORD flags = CALLBACK_FUNCTION | WAVE_DIRECTSOUND;
if (ds_hw_accel != DS_HW_ACCEL_EMULATION)
flags |= WAVE_DIRECTSOUND;
/* Wine-only: the driver wants us to reopen the device */ /* Wine-only: the driver wants us to reopen the device */
/* FIXME: check for errors */ /* FIXME: check for errors */
IDsDriverBuffer_Release(device->hwbuf); IDsDriverBuffer_Release(device->hwbuf);
@ -415,7 +413,7 @@ HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex)
if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMSETFORMAT) { if (device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMSETFORMAT) {
DWORD flags = CALLBACK_FUNCTION; DWORD flags = CALLBACK_FUNCTION;
if (ds_hw_accel != DS_HW_ACCEL_EMULATION) if (device->driver)
flags |= WAVE_DIRECTSOUND; flags |= WAVE_DIRECTSOUND;
/* FIXME: check for errors */ /* FIXME: check for errors */
DSOUND_PrimaryClose(device); DSOUND_PrimaryClose(device);