From aa8559e84a0526f9746dedaad3ad22b49e062963 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Tue, 29 Apr 2003 22:54:09 +0000 Subject: [PATCH] Fixed a problem where OSS trigger support is inconsistent. --- dlls/winmm/wineoss/audio.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/winmm/wineoss/audio.c b/dlls/winmm/wineoss/audio.c index 61ef9abb210..1b79a7f7eb6 100644 --- a/dlls/winmm/wineoss/audio.c +++ b/dlls/winmm/wineoss/audio.c @@ -3383,6 +3383,20 @@ static HRESULT WINAPI IDsCaptureDriverBufferImpl_Start(PIDSCDRIVERBUFFER iface, 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) { + /* try the opposite output enable */ + if (WInDev[This->drv->wDevID].ossdev->bOutputEnabled == FALSE) + WInDev[This->drv->wDevID].ossdev->bOutputEnabled = TRUE; + else + 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) + 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; return DSERR_GENERIC;