From: Pierre Ossman Date: Tue, 2 May 2006 11:27:24 +0000 (+0000) Subject: Fix control flow in pa_oss_open(). Also fall back to half duplex when device doesn't X-Git-Tag: 1.0_branch~3694 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2c9f251004f4f688d1a9a20d1ec19ea3513a60a;p=profile%2Fivi%2Fpulseaudio.git Fix control flow in pa_oss_open(). Also fall back to half duplex when device doesn't support full. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@826 fefdeb5f-60dc-0310-8127-8f9354f1896f --- diff --git a/src/modules/oss-util.c b/src/modules/oss-util.c index fac39e7..2c573b2 100644 --- a/src/modules/oss-util.c +++ b/src/modules/oss-util.c @@ -56,9 +56,11 @@ int pa_oss_open(const char *device, int *mode, int* pcaps) { } if (*tcaps & DSP_CAP_DUPLEX) - return fd; + goto success; - goto fail; + pa_log_warn(__FILE__": '%s' doesn't support full duplex", device); + + close(fd); } if ((fd = open(device, (*mode = O_WRONLY)|O_NDELAY)) < 0) { @@ -74,6 +76,8 @@ int pa_oss_open(const char *device, int *mode, int* pcaps) { } } +success: + if (pcaps) { if (ioctl(fd, SNDCTL_DSP_GETCAPS, pcaps) < 0) { pa_log(__FILE__": SNDCTL_DSP_GETCAPS: %s", strerror(errno));