Commit cf230457 authored by Jeremy White's avatar Jeremy White Committed by Alexandre Julliard

More correctly establish cases where the OSS input buffer should not

be enabled.
parent 7dea79c4
...@@ -375,11 +375,27 @@ static DWORD OSS_RawOpenDevice(OSS_DEVICE* ossdev, int strict_format) ...@@ -375,11 +375,27 @@ static DWORD OSS_RawOpenDevice(OSS_DEVICE* ossdev, int strict_format)
ossdev->bOutputEnabled = ((trigger & PCM_ENABLE_OUTPUT) == PCM_ENABLE_OUTPUT); ossdev->bOutputEnabled = ((trigger & PCM_ENABLE_OUTPUT) == PCM_ENABLE_OUTPUT);
ossdev->bInputEnabled = ((trigger & PCM_ENABLE_INPUT) == PCM_ENABLE_INPUT); ossdev->bInputEnabled = ((trigger & PCM_ENABLE_INPUT) == PCM_ENABLE_INPUT);
/* If we do not have full duplex, but they opened RDWR
** (as you have to in order for an mmap to succeed)
** then we start out with input off
*/
if (ossdev->open_access == O_RDWR && !ossdev->full_duplex &&
ossdev->bInputEnabled && ossdev->bOutputEnabled) {
ossdev->bInputEnabled = FALSE;
trigger &= ~PCM_ENABLE_INPUT;
ioctl(fd, SNDCTL_DSP_SETTRIGGER, &trigger);
}
} else { } else {
ossdev->bOutputEnabled = TRUE; /* OSS enables by default */ ossdev->bOutputEnabled = TRUE; /* OSS enables by default */
ossdev->bInputEnabled = TRUE; /* OSS enables by default */ ossdev->bInputEnabled = TRUE; /* OSS enables by default */
} }
if (ossdev->open_access == O_RDONLY)
ossdev->bOutputEnabled = FALSE;
if (ossdev->open_access == O_WRONLY)
ossdev->bInputEnabled = FALSE;
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
error: error:
......
...@@ -735,6 +735,7 @@ static HRESULT WINAPI IDsDriverImpl_Open(PIDSDRIVER iface) ...@@ -735,6 +735,7 @@ static HRESULT WINAPI IDsDriverImpl_Open(PIDSDRIVER iface)
/* make sure the card doesn't start playing before we want it to */ /* make sure the card doesn't start playing before we want it to */
WOutDev[This->wDevID].ossdev->bOutputEnabled = FALSE; WOutDev[This->wDevID].ossdev->bOutputEnabled = FALSE;
WOutDev[This->wDevID].ossdev->bInputEnabled = FALSE;
enable = getEnables(WOutDev[This->wDevID].ossdev); enable = getEnables(WOutDev[This->wDevID].ossdev);
if (ioctl(WOutDev[This->wDevID].ossdev->fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) { 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)); ERR("ioctl(%s, SNDCTL_DSP_SETTRIGGER) failed (%s)\n",WOutDev[This->wDevID].ossdev->dev_name, strerror(errno));
...@@ -815,6 +816,7 @@ static HRESULT WINAPI DSD_CreatePrimaryBuffer(PIDSDRIVER iface, ...@@ -815,6 +816,7 @@ static HRESULT WINAPI DSD_CreatePrimaryBuffer(PIDSDRIVER iface,
*ppbBuffer = (*ippdsdb)->mapping; *ppbBuffer = (*ippdsdb)->mapping;
/* some drivers need some extra nudging after mapping */ /* some drivers need some extra nudging after mapping */
WOutDev[This->wDevID].ossdev->bInputEnabled = FALSE;
WOutDev[This->wDevID].ossdev->bOutputEnabled = FALSE; WOutDev[This->wDevID].ossdev->bOutputEnabled = FALSE;
enable = getEnables(WOutDev[This->wDevID].ossdev); enable = getEnables(WOutDev[This->wDevID].ossdev);
if (ioctl((*ippdsdb)->fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) { if (ioctl((*ippdsdb)->fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) {
......
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