More correctly establish cases where the OSS input buffer should not
be enabled.
This commit is contained in:
parent
7dea79c487
commit
cf23045791
|
@ -375,11 +375,27 @@ static DWORD OSS_RawOpenDevice(OSS_DEVICE* ossdev, int strict_format)
|
|||
|
||||
ossdev->bOutputEnabled = ((trigger & PCM_ENABLE_OUTPUT) == PCM_ENABLE_OUTPUT);
|
||||
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 {
|
||||
ossdev->bOutputEnabled = 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;
|
||||
|
||||
error:
|
||||
|
|
|
@ -735,6 +735,7 @@ static HRESULT WINAPI IDsDriverImpl_Open(PIDSDRIVER 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));
|
||||
|
@ -815,6 +816,7 @@ 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);
|
||||
if (ioctl((*ippdsdb)->fd, SNDCTL_DSP_SETTRIGGER, &enable) < 0) {
|
||||
|
|
Loading…
Reference in New Issue