dsound: Sound acceleration fixes.
This commit is contained in:
parent
4536a9d66d
commit
3f762d5d0b
|
@ -1411,14 +1411,12 @@ 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 */
|
||||
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 */
|
||||
if (device->driver) {
|
||||
hr = IDsDriver_GetDriverDesc(device->driver,&(device->drvdesc));
|
||||
|
@ -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),
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue