Tijl Coosemans : wineoss: Avoid SNDCTL_DSP_GETTRIGGER.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Aug 8 08:59:35 CDT 2007
Module: wine
Branch: master
Commit: 3429068f35376f2d817b7ba8b98af69adc6a3a60
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3429068f35376f2d817b7ba8b98af69adc6a3a60
Author: Tijl Coosemans <tijl at ulyssis.org>
Date: Wed Aug 8 00:19:14 2007 +0200
wineoss: Avoid SNDCTL_DSP_GETTRIGGER.
---
dlls/wineoss.drv/audio.c | 26 ++++++++------------------
1 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/dlls/wineoss.drv/audio.c b/dlls/wineoss.drv/audio.c
index e9c93f7..5c233da 100644
--- a/dlls/wineoss.drv/audio.c
+++ b/dlls/wineoss.drv/audio.c
@@ -389,18 +389,16 @@ static DWORD OSS_RawOpenDevice(OSS_DEVICE* ossdev, int strict_format)
}
ossdev->fd = fd;
+ 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;
+
if (ossdev->bTriggerSupport) {
int trigger;
- rc = ioctl(fd, SNDCTL_DSP_GETTRIGGER, &trigger);
- if (rc != 0) {
- ERR("ioctl(%s, SNDCTL_DSP_GETTRIGGER) failed (%s)\n",
- ossdev->dev_name, strerror(errno));
- goto error;
- }
-
- ossdev->bOutputEnabled = ((trigger & PCM_ENABLE_OUTPUT) == PCM_ENABLE_OUTPUT);
- ossdev->bInputEnabled = ((trigger & PCM_ENABLE_INPUT) == PCM_ENABLE_INPUT);
-
+ trigger = getEnables(ossdev);
/* 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
@@ -411,16 +409,8 @@ static DWORD OSS_RawOpenDevice(OSS_DEVICE* ossdev, int strict_format)
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:
More information about the wine-cvs
mailing list