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
This commit is contained in:
Pierre Ossman 2006-05-02 11:27:24 +00:00
parent 27cee2ef52
commit c2c9f25100

View file

@ -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));