Commit 58e26451 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

wineoss: Seperate wave-in and wave-outs shared use of a single OSS_DEVICE struct.

parent 847d5565
......@@ -110,7 +110,7 @@ typedef struct tagOSS_DEVICE {
} OSS_DEVICE;
typedef struct {
OSS_DEVICE* ossdev;
OSS_DEVICE ossdev;
volatile int state; /* one of the WINE_WS_ manifest constants */
WAVEOPENDESC waveDesc;
WORD wFlags;
......@@ -143,7 +143,7 @@ typedef struct {
} WINE_WAVEOUT;
typedef struct {
OSS_DEVICE* ossdev;
OSS_DEVICE ossdev;
volatile int state;
DWORD dwFragmentSize; /* OpenSound '/dev/dsp' give us that size */
WAVEOPENDESC waveDesc;
......@@ -160,7 +160,6 @@ typedef struct {
OSS_MSG_RING msgRing;
} WINE_WAVEIN;
extern OSS_DEVICE OSS_Devices[MAX_WAVEDRV];
extern WINE_WAVEOUT WOutDev[MAX_WAVEDRV];
extern WINE_WAVEIN WInDev[MAX_WAVEDRV];
extern unsigned numOutDev;
......
......@@ -356,7 +356,7 @@ static HRESULT DSCDB_MapBuffer(IDsCaptureDriverBufferImpl *dscdb)
{
if (!dscdb->mapping) {
dscdb->mapping = mmap(NULL, dscdb->maplen, PROT_READ, MAP_SHARED,
WInDev[dscdb->drv->wDevID].ossdev->fd, 0);
WInDev[dscdb->drv->wDevID].ossdev.fd, 0);
if (dscdb->mapping == (LPBYTE)-1) {
TRACE("(%p): Could not map sound device for direct access (%s)\n",
dscdb, strerror(errno));
......@@ -462,7 +462,7 @@ static ULONG WINAPI IDsCaptureDriverBufferImpl_Release(PIDSCDRIVERBUFFER iface)
DSCDB_UnmapBuffer(This);
OSS_CloseDevice(wwi->ossdev);
OSS_CloseDevice(&wwi->ossdev);
wwi->state = WINE_WS_CLOSED;
wwi->dwFragmentSize = 0;
This->drv->capture_buffer = NULL;
......@@ -619,28 +619,28 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_Start(
if (dwFlags & DSCBSTART_LOOPING)
This->is_looping = TRUE;
WInDev[This->drv->wDevID].ossdev->bInputEnabled = TRUE;
enable = getEnables(WInDev[This->drv->wDevID].ossdev);
if (ioctl(WInDev[This->drv->wDevID].ossdev->fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) {
WInDev[This->drv->wDevID].ossdev.bInputEnabled = TRUE;
enable = getEnables(&WInDev[This->drv->wDevID].ossdev);
if (ioctl(WInDev[This->drv->wDevID].ossdev.fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) {
if (errno == EINVAL) {
/* Don't give up yet. OSS trigger support is inconsistent. */
if (WInDev[This->drv->wDevID].ossdev->open_count == 1) {
if (WInDev[This->drv->wDevID].ossdev.open_count == 1) {
/* try the opposite output enable */
if (WInDev[This->drv->wDevID].ossdev->bOutputEnabled == FALSE)
WInDev[This->drv->wDevID].ossdev->bOutputEnabled = TRUE;
if (WInDev[This->drv->wDevID].ossdev.bOutputEnabled == FALSE)
WInDev[This->drv->wDevID].ossdev.bOutputEnabled = TRUE;
else
WInDev[This->drv->wDevID].ossdev->bOutputEnabled = FALSE;
WInDev[This->drv->wDevID].ossdev.bOutputEnabled = FALSE;
/* try it again */
enable = getEnables(WInDev[This->drv->wDevID].ossdev);
if (ioctl(WInDev[This->drv->wDevID].ossdev->fd, SNDCTL_DSP_SETTRIGGER, &enable) >= 0) {
enable = getEnables(&WInDev[This->drv->wDevID].ossdev);
if (ioctl(WInDev[This->drv->wDevID].ossdev.fd, SNDCTL_DSP_SETTRIGGER, &enable) >= 0) {
This->is_capturing = TRUE;
return DS_OK;
}
}
}
ERR("ioctl(%s, SNDCTL_DSP_SETTRIGGER) failed (%s)\n",
WInDev[This->drv->wDevID].ossdev->dev_name, strerror(errno));
WInDev[This->drv->wDevID].ossdev->bInputEnabled = FALSE;
WInDev[This->drv->wDevID].ossdev.dev_name, strerror(errno));
WInDev[This->drv->wDevID].ossdev.bInputEnabled = FALSE;
return DSERR_GENERIC;
}
......@@ -658,11 +658,11 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_Stop(PIDSCDRIVERBUFFER iface)
return DS_OK;
/* no more capturing */
WInDev[This->drv->wDevID].ossdev->bInputEnabled = FALSE;
enable = getEnables(WInDev[This->drv->wDevID].ossdev);
if (ioctl(WInDev[This->drv->wDevID].ossdev->fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) {
WInDev[This->drv->wDevID].ossdev.bInputEnabled = FALSE;
enable = getEnables(&WInDev[This->drv->wDevID].ossdev);
if (ioctl(WInDev[This->drv->wDevID].ossdev.fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) {
ERR("ioctl(%s, SNDCTL_DSP_SETTRIGGER) failed (%s)\n",
WInDev[This->drv->wDevID].ossdev->dev_name, strerror(errno));
WInDev[This->drv->wDevID].ossdev.dev_name, strerror(errno));
return DSERR_GENERIC;
}
......@@ -769,7 +769,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_GetDriverDesc(
}
/* copy version from driver */
memcpy(pDesc, &(WInDev[This->wDevID].ossdev->ds_desc), sizeof(DSDRIVERDESC));
memcpy(pDesc, &(WInDev[This->wDevID].ossdev.ds_desc), sizeof(DSDRIVERDESC));
pDesc->dnDevNode = WInDev[This->wDevID].waveDesc.dnDevNode;
pDesc->wVxdId = 0;
......@@ -809,7 +809,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_GetCaps(
{
IDsCaptureDriverImpl *This = (IDsCaptureDriverImpl *)iface;
TRACE("(%p,%p)\n",This,pCaps);
memcpy(pCaps, &(WInDev[This->wDevID].ossdev->dsc_caps), sizeof(DSCDRIVERCAPS));
memcpy(pCaps, &(WInDev[This->wDevID].ossdev.dsc_caps), sizeof(DSCDRIVERCAPS));
return DS_OK;
}
......@@ -902,7 +902,7 @@ static DWORD CALLBACK DSCDB_Thread(LPVOID lpParameter)
/* get the current DMA position */
if (ioctl(This->fd, SNDCTL_DSP_GETIPTR, &info) < 0) {
ERR("ioctl(%s, SNDCTL_DSP_GETIPTR) failed (%s)\n",
WInDev[This->drv->wDevID].ossdev->dev_name, strerror(errno));
WInDev[This->drv->wDevID].ossdev.dev_name, strerror(errno));
return DSERR_GENERIC;
}
......@@ -1044,9 +1044,9 @@ static HRESULT WINAPI IDsCaptureDriverImpl_CreateCaptureBuffer(
if (wwi->state == WINE_WS_CLOSED) {
unsigned int frag_size;
if (wwi->ossdev->open_count > 0) {
if (wwi->ossdev.open_count > 0) {
/* opened already so use existing fragment size */
audio_fragment = wwi->ossdev->audio_fragment;
audio_fragment = wwi->ossdev.audio_fragment;
} else {
/* calculate a fragment size */
unsigned int mask = 0xffffffff;
......@@ -1107,7 +1107,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_CreateCaptureBuffer(
audio_fragment >> 16, frag_size, frag_size * (audio_fragment >> 16),
(frag_size * 1000) / pwfx->nAvgBytesPerSec);
ret = OSS_OpenDevice(wwi->ossdev, O_RDWR, &audio_fragment, 1,
ret = OSS_OpenDevice(&wwi->ossdev, O_RDWR, &audio_fragment, 1,
pwfx->nSamplesPerSec,
(pwfx->nChannels > 1) ? 1 : 0,
(pwfx->wBitsPerSample == 16)
......@@ -1123,10 +1123,10 @@ static HRESULT WINAPI IDsCaptureDriverImpl_CreateCaptureBuffer(
wwi->state = WINE_WS_STOPPED;
/* find out what fragment and buffer sizes OSS gave us */
if (ioctl(wwi->ossdev->fd, SNDCTL_DSP_GETISPACE, &info) < 0) {
if (ioctl(wwi->ossdev.fd, SNDCTL_DSP_GETISPACE, &info) < 0) {
ERR("ioctl(%s, SNDCTL_DSP_GETISPACE) failed (%s)\n",
wwi->ossdev->dev_name, strerror(errno));
OSS_CloseDevice(wwi->ossdev);
wwi->ossdev.dev_name, strerror(errno));
OSS_CloseDevice(&wwi->ossdev);
wwi->state = WINE_WS_CLOSED;
HeapFree(GetProcessHeap(),0,*ippdscdb);
*ippdscdb = NULL;
......@@ -1152,11 +1152,11 @@ static HRESULT WINAPI IDsCaptureDriverImpl_CreateCaptureBuffer(
TRACE("same buffer length but different fragment size\n");
}
}
(*ippdscdb)->fd = WInDev[This->wDevID].ossdev->fd;
(*ippdscdb)->fd = WInDev[This->wDevID].ossdev.fd;
if (pipe((*ippdscdb)->pipe_fd) < 0) {
TRACE("pipe() failed (%s)\n", strerror(errno));
OSS_CloseDevice(wwi->ossdev);
OSS_CloseDevice(&wwi->ossdev);
wwi->state = WINE_WS_CLOSED;
HeapFree(GetProcessHeap(),0,*ippdscdb);
*ippdscdb = NULL;
......@@ -1164,10 +1164,10 @@ static HRESULT WINAPI IDsCaptureDriverImpl_CreateCaptureBuffer(
}
/* check how big the DMA buffer is now */
if (ioctl(wwi->ossdev->fd, SNDCTL_DSP_GETISPACE, &info) < 0) {
if (ioctl(wwi->ossdev.fd, SNDCTL_DSP_GETISPACE, &info) < 0) {
ERR("ioctl(%s, SNDCTL_DSP_GETISPACE) failed (%s)\n",
wwi->ossdev->dev_name, strerror(errno));
OSS_CloseDevice(wwi->ossdev);
wwi->ossdev.dev_name, strerror(errno));
OSS_CloseDevice(&wwi->ossdev);
wwi->state = WINE_WS_CLOSED;
close((*ippdscdb)->pipe_fd[0]);
close((*ippdscdb)->pipe_fd[1]);
......@@ -1184,7 +1184,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_CreateCaptureBuffer(
/* map the DMA buffer */
err = DSCDB_MapBuffer(*ippdscdb);
if (err != DS_OK) {
OSS_CloseDevice(wwi->ossdev);
OSS_CloseDevice(&wwi->ossdev);
wwi->state = WINE_WS_CLOSED;
close((*ippdscdb)->pipe_fd[0]);
close((*ippdscdb)->pipe_fd[1]);
......@@ -1198,7 +1198,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_CreateCaptureBuffer(
(*ippdscdb)->buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,(*ippdscdb)->buflen);
if ((*ippdscdb)->buffer == NULL) {
OSS_CloseDevice(wwi->ossdev);
OSS_CloseDevice(&wwi->ossdev);
wwi->state = WINE_WS_CLOSED;
close((*ippdscdb)->pipe_fd[0]);
close((*ippdscdb)->pipe_fd[1]);
......@@ -1284,7 +1284,7 @@ DWORD widDsCreate(UINT wDevID, PIDSCDRIVER* drv)
TRACE("(%d,%p)\n",wDevID,drv);
/* the HAL isn't much better than the HEL if we can't do mmap() */
if (!(WInDev[wDevID].ossdev->in_caps_support & WAVECAPS_DIRECTSOUND)) {
if (!(WInDev[wDevID].ossdev.in_caps_support & WAVECAPS_DIRECTSOUND)) {
ERR("DirectSoundCapture flag not set\n");
MESSAGE("This sound card's driver does not support direct access\n");
MESSAGE("The (slower) DirectSound HEL mode will be used instead.\n");
......@@ -1304,7 +1304,7 @@ DWORD widDsCreate(UINT wDevID, PIDSCDRIVER* drv)
DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc)
{
memcpy(desc, &(WInDev[wDevID].ossdev->ds_desc), sizeof(DSDRIVERDESC));
memcpy(desc, &(WInDev[wDevID].ossdev.ds_desc), sizeof(DSDRIVERDESC));
return MMSYSERR_NOERROR;
}
......
......@@ -475,8 +475,8 @@ static ULONG WINAPI IDsDriverBufferImpl_Release(PIDSDRIVERBUFFER iface)
TRACE("(%p) buffer count is now %d\n", This, This->drv->nrofsecondaries);
}
WOutDev[This->drv->wDevID].ossdev->ds_caps.dwFreeHwMixingAllBuffers++;
WOutDev[This->drv->wDevID].ossdev->ds_caps.dwFreeHwMixingStreamingBuffers++;
WOutDev[This->drv->wDevID].ossdev.ds_caps.dwFreeHwMixingAllBuffers++;
WOutDev[This->drv->wDevID].ossdev.ds_caps.dwFreeHwMixingStreamingBuffers++;
}
DSDB_UnmapBuffer(This);
......@@ -566,14 +566,14 @@ static HRESULT WINAPI IDsDriverBufferImpl_GetPosition(PIDSDRIVERBUFFER iface,
}
if (ioctl(This->fd, SNDCTL_DSP_GETOPTR, &info) < 0) {
ERR("ioctl(%s, SNDCTL_DSP_GETOPTR) failed (%s)\n",
WOutDev[This->drv->wDevID].ossdev->dev_name, strerror(errno));
WOutDev[This->drv->wDevID].ossdev.dev_name, strerror(errno));
return DSERR_GENERIC;
}
ptr = info.ptr & ~3; /* align the pointer, just in case */
if (lpdwPlay) *lpdwPlay = ptr;
if (lpdwWrite) {
/* add some safety margin (not strictly necessary, but...) */
if (WOutDev[This->drv->wDevID].ossdev->duplex_out_caps.dwSupport & WAVECAPS_SAMPLEACCURATE)
if (WOutDev[This->drv->wDevID].ossdev.duplex_out_caps.dwSupport & WAVECAPS_SAMPLEACCURATE)
*lpdwWrite = ptr + 32;
else
*lpdwWrite = ptr + WOutDev[This->drv->wDevID].dwFragmentSize;
......@@ -589,26 +589,26 @@ static HRESULT WINAPI IDsDriverBufferImpl_Play(PIDSDRIVERBUFFER iface, DWORD dwR
IDsDriverBufferImpl *This = (IDsDriverBufferImpl *)iface;
int enable;
TRACE("(%p,%x,%x,%x)\n",iface,dwRes1,dwRes2,dwFlags);
WOutDev[This->drv->wDevID].ossdev->bOutputEnabled = TRUE;
enable = getEnables(WOutDev[This->drv->wDevID].ossdev);
WOutDev[This->drv->wDevID].ossdev.bOutputEnabled = TRUE;
enable = getEnables(&WOutDev[This->drv->wDevID].ossdev);
if (ioctl(This->fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) {
if (errno == EINVAL) {
/* Don't give up yet. OSS trigger support is inconsistent. */
if (WOutDev[This->drv->wDevID].ossdev->open_count == 1) {
if (WOutDev[This->drv->wDevID].ossdev.open_count == 1) {
/* try the opposite input enable */
if (WOutDev[This->drv->wDevID].ossdev->bInputEnabled == FALSE)
WOutDev[This->drv->wDevID].ossdev->bInputEnabled = TRUE;
if (WOutDev[This->drv->wDevID].ossdev.bInputEnabled == FALSE)
WOutDev[This->drv->wDevID].ossdev.bInputEnabled = TRUE;
else
WOutDev[This->drv->wDevID].ossdev->bInputEnabled = FALSE;
WOutDev[This->drv->wDevID].ossdev.bInputEnabled = FALSE;
/* try it again */
enable = getEnables(WOutDev[This->drv->wDevID].ossdev);
enable = getEnables(&WOutDev[This->drv->wDevID].ossdev);
if (ioctl(This->fd, SNDCTL_DSP_SETTRIGGER, &enable) >= 0)
return DS_OK;
}
}
ERR("ioctl(%s, SNDCTL_DSP_SETTRIGGER) failed (%s)\n",
WOutDev[This->drv->wDevID].ossdev->dev_name, strerror(errno));
WOutDev[This->drv->wDevID].ossdev->bOutputEnabled = FALSE;
WOutDev[This->drv->wDevID].ossdev.dev_name, strerror(errno));
WOutDev[This->drv->wDevID].ossdev.bOutputEnabled = FALSE;
return DSERR_GENERIC;
}
return DS_OK;
......@@ -620,16 +620,16 @@ static HRESULT WINAPI IDsDriverBufferImpl_Stop(PIDSDRIVERBUFFER iface)
int enable;
TRACE("(%p)\n",iface);
/* no more playing */
WOutDev[This->drv->wDevID].ossdev->bOutputEnabled = FALSE;
enable = getEnables(WOutDev[This->drv->wDevID].ossdev);
WOutDev[This->drv->wDevID].ossdev.bOutputEnabled = FALSE;
enable = getEnables(&WOutDev[This->drv->wDevID].ossdev);
if (ioctl(This->fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) {
ERR("ioctl(%s, SNDCTL_DSP_SETTRIGGER) failed (%s)\n", WOutDev[This->drv->wDevID].ossdev->dev_name, strerror(errno));
ERR("ioctl(%s, SNDCTL_DSP_SETTRIGGER) failed (%s)\n", WOutDev[This->drv->wDevID].ossdev.dev_name, strerror(errno));
return DSERR_GENERIC;
}
#if 0
/* the play position must be reset to the beginning of the buffer */
if (ioctl(This->fd, SNDCTL_DSP_RESET, 0) < 0) {
ERR("ioctl(%s, SNDCTL_DSP_RESET) failed (%s)\n", WOutDev[This->drv->wDevID].ossdev->dev_name, strerror(errno));
ERR("ioctl(%s, SNDCTL_DSP_RESET) failed (%s)\n", WOutDev[This->drv->wDevID].ossdev.dev_name, strerror(errno));
return DSERR_GENERIC;
}
#endif
......@@ -638,7 +638,7 @@ static HRESULT WINAPI IDsDriverBufferImpl_Stop(PIDSDRIVERBUFFER iface)
* that it should completely recreate this HW buffer...
* this unexpected error code should do the trick... */
/* FIXME: ...unless we are doing full duplex, then it's not nice to close the device */
if (WOutDev[This->drv->wDevID].ossdev->open_count == 1)
if (WOutDev[This->drv->wDevID].ossdev.open_count == 1)
return DSERR_BUFFERLOST;
return DS_OK;
......@@ -710,7 +710,7 @@ static HRESULT WINAPI IDsDriverImpl_GetDriverDesc(PIDSDRIVER iface,
TRACE("(%p,%p)\n",iface,pDesc);
/* copy version from driver */
memcpy(pDesc, &(WOutDev[This->wDevID].ossdev->ds_desc), sizeof(DSDRIVERDESC));
memcpy(pDesc, &(WOutDev[This->wDevID].ossdev.ds_desc), sizeof(DSDRIVERDESC));
pDesc->dwFlags |= DSDDESC_DOMMSYSTEMOPEN | DSDDESC_DOMMSYSTEMSETFORMAT |
DSDDESC_USESYSTEMMEMORY | DSDDESC_DONTNEEDPRIMARYLOCK |
......@@ -736,11 +736,11 @@ static HRESULT WINAPI IDsDriverImpl_Open(PIDSDRIVER iface)
TRACE("(%p)\n",iface);
/* make sure the card doesn't start playing before we want it to */
WOutDev[This->wDevID].ossdev->bOutputEnabled = FALSE;
WOutDev[This->wDevID].ossdev->bInputEnabled = FALSE;
enable = getEnables(WOutDev[This->wDevID].ossdev);
if (ioctl(WOutDev[This->wDevID].ossdev->fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) {
ERR("ioctl(%s, SNDCTL_DSP_SETTRIGGER) failed (%s)\n",WOutDev[This->wDevID].ossdev->dev_name, strerror(errno));
WOutDev[This->wDevID].ossdev.bOutputEnabled = FALSE;
WOutDev[This->wDevID].ossdev.bInputEnabled = FALSE;
enable = getEnables(&WOutDev[This->wDevID].ossdev);
if (ioctl(WOutDev[This->wDevID].ossdev.fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) {
ERR("ioctl(%s, SNDCTL_DSP_SETTRIGGER) failed (%s)\n",WOutDev[This->wDevID].ossdev.dev_name, strerror(errno));
return DSERR_GENERIC;
}
return DS_OK;
......@@ -761,7 +761,7 @@ static HRESULT WINAPI IDsDriverImpl_GetCaps(PIDSDRIVER iface, PDSDRIVERCAPS pCap
{
IDsDriverImpl *This = (IDsDriverImpl *)iface;
TRACE("(%p,%p)\n",iface,pCaps);
memcpy(pCaps, &(WOutDev[This->wDevID].ossdev->ds_caps), sizeof(DSDRIVERCAPS));
memcpy(pCaps, &(WOutDev[This->wDevID].ossdev.ds_caps), sizeof(DSDRIVERCAPS));
return DS_OK;
}
......@@ -792,13 +792,13 @@ static HRESULT WINAPI DSD_CreatePrimaryBuffer(PIDSDRIVER iface,
(*ippdsdb)->ref = 1;
(*ippdsdb)->drv = This;
copy_format(pwfx, &(*ippdsdb)->wfex);
(*ippdsdb)->fd = WOutDev[This->wDevID].ossdev->fd;
(*ippdsdb)->fd = WOutDev[This->wDevID].ossdev.fd;
(*ippdsdb)->dwFlags = dwFlags;
/* check how big the DMA buffer is now */
if (ioctl((*ippdsdb)->fd, SNDCTL_DSP_GETOSPACE, &info) < 0) {
ERR("ioctl(%s, SNDCTL_DSP_GETOSPACE) failed (%s)\n",
WOutDev[This->wDevID].ossdev->dev_name, strerror(errno));
WOutDev[This->wDevID].ossdev.dev_name, strerror(errno));
HeapFree(GetProcessHeap(),0,*ippdsdb);
*ippdsdb = NULL;
return DSERR_GENERIC;
......@@ -818,12 +818,12 @@ static HRESULT WINAPI DSD_CreatePrimaryBuffer(PIDSDRIVER iface,
*ppbBuffer = (*ippdsdb)->mapping;
/* some drivers need some extra nudging after mapping */
WOutDev[This->wDevID].ossdev->bInputEnabled = FALSE;
WOutDev[This->wDevID].ossdev->bOutputEnabled = FALSE;
enable = getEnables(WOutDev[This->wDevID].ossdev);
WOutDev[This->wDevID].ossdev.bInputEnabled = FALSE;
WOutDev[This->wDevID].ossdev.bOutputEnabled = FALSE;
enable = getEnables(&WOutDev[This->wDevID].ossdev);
if (ioctl((*ippdsdb)->fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) {
ERR("ioctl(%s, SNDCTL_DSP_SETTRIGGER) failed (%s)\n",
WOutDev[This->wDevID].ossdev->dev_name, strerror(errno));
WOutDev[This->wDevID].ossdev.dev_name, strerror(errno));
return DSERR_GENERIC;
}
......@@ -939,7 +939,7 @@ DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv)
TRACE("(%d,%p)\n",wDevID,drv);
/* the HAL isn't much better than the HEL if we can't do mmap() */
if (!(WOutDev[wDevID].ossdev->duplex_out_caps.dwSupport & WAVECAPS_DIRECTSOUND)) {
if (!(WOutDev[wDevID].ossdev.duplex_out_caps.dwSupport & WAVECAPS_DIRECTSOUND)) {
WARN("Warn DirectSound flag not set, falling back to HEL layer\n");
return MMSYSERR_NOTSUPPORTED;
}
......@@ -960,7 +960,7 @@ DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv)
DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc)
{
TRACE("(%d,%p)\n",wDevID,desc);
memcpy(desc, &(WOutDev[wDevID].ossdev->ds_desc), sizeof(DSDRIVERDESC));
memcpy(desc, &(WOutDev[wDevID].ossdev.ds_desc), sizeof(DSDRIVERDESC));
return MMSYSERR_NOERROR;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment