aboutsummaryrefslogtreecommitdiffstats
path: root/audio/ossaudio.c
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-01-15 16:12:09 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-01-15 16:12:09 -0800
commit0724eefc1939d32ff3c1c00a47ca6b8cccff1edd (patch)
treeb693f74b51fc01bfc3f3de0c6d3c9ca1c77fcdf1 /audio/ossaudio.c
parentc2db2b6accc7888df514261a7240e7759df95a4c (diff)
downloadexternal_qemu-0724eefc1939d32ff3c1c00a47ca6b8cccff1edd.zip
external_qemu-0724eefc1939d32ff3c1c00a47ca6b8cccff1edd.tar.gz
external_qemu-0724eefc1939d32ff3c1c00a47ca6b8cccff1edd.tar.bz2
auto import from //branches/cupcake/...@126645
Diffstat (limited to 'audio/ossaudio.c')
-rw-r--r--audio/ossaudio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 4d36e45..17d676a 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -231,7 +231,7 @@ static int oss_open (int in, struct oss_params *req,
goto err;
}
- if (ioctl (fd, SNDCTL_DSP_NONBLOCK)) {
+ if (ioctl (fd, SNDCTL_DSP_NONBLOCK, NULL)) {
oss_logerr2 (errno, typ, "Failed to set non-blocking mode\n");
goto err;
}
@@ -248,6 +248,12 @@ static int oss_open (int in, struct oss_params *req,
goto err;
}
+ if (!abinfo.fragstotal || !abinfo.fragsize) {
+ AUD_log(AUDIO_CAP, "Returned bogus buffer information(%d, %d) for %s\n",
+ abinfo.fragstotal, abinfo.fragsize, typ);
+ goto err;
+ }
+
obt->fmt = fmt;
obt->nchannels = nchannels;
obt->freq = freq;