mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
dsound: Handle failing of IDsDriver_CreateSoundBuffer better.
This commit is contained in:
parent
4a2424d6a3
commit
9c469e1a94
@ -224,8 +224,19 @@ HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device)
|
||||
&(device->buflen),&(device->buffer),
|
||||
(LPVOID*)&(device->hwbuf));
|
||||
if (err != DS_OK) {
|
||||
WARN("IDsDriver_CreateSoundBuffer failed\n");
|
||||
return err;
|
||||
WARN("IDsDriver_CreateSoundBuffer failed, falling back to waveout\n");
|
||||
/* Wine-only: close wine directsound driver, then reopen without WAVE_DIRECTSOUND */
|
||||
device->drvdesc.dwFlags = DSDDESC_DOMMSYSTEMOPEN | DSDDESC_DOMMSYSTEMSETFORMAT;
|
||||
waveOutClose(device->hwo);
|
||||
IDsDriver_Release(device->driver);
|
||||
device->driver = device->buffer = NULL;
|
||||
device->hwo = 0;
|
||||
err = mmErr(waveOutOpen(&(device->hwo), device->drvdesc.dnDevNode, device->pwfx, (DWORD_PTR)DSOUND_callback, (DWORD)device, CALLBACK_FUNCTION));
|
||||
if (err != DS_OK)
|
||||
{
|
||||
WARN("Falling back to waveout failed too! Giving up\n");
|
||||
return err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -344,9 +344,7 @@ static HRESULT DSDB_MapBuffer(IDsDriverBufferImpl *dsdb)
|
||||
dsdb->mapping = mmap(NULL, dsdb->maplen, PROT_WRITE, MAP_SHARED,
|
||||
dsdb->fd, 0);
|
||||
if (dsdb->mapping == (LPBYTE)-1) {
|
||||
ERR("Could not map sound device for direct access (%s)\n", strerror(errno));
|
||||
ERR("Please run winecfg, open \"Audio\" page and set\n"
|
||||
"\"Hardware Acceleration\" to \"Emulation\".\n");
|
||||
WARN("Could not map sound device for direct access (%s)\n", strerror(errno));
|
||||
return DSERR_GENERIC;
|
||||
}
|
||||
TRACE("The sound device has been mapped for direct access at %p, size=%d\n", dsdb->mapping, dsdb->maplen);
|
||||
|
Loading…
Reference in New Issue
Block a user