summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2012-10-30 17:36:41 +0000
committerwm4 <wm4@nowhere>2012-10-31 22:37:48 +0100
commit1ad5f3f0a40e1f1df82a2ea10efd8d074825b151 (patch)
tree261ee70238531ab503556967c8f073ef64fbfeb3 /libao2
parent3bebbe066d06ee276c063c897805ebdc8b2825a4 (diff)
downloadmpv-1ad5f3f0a40e1f1df82a2ea10efd8d074825b151.tar.bz2
mpv-1ad5f3f0a40e1f1df82a2ea10efd8d074825b151.tar.xz
ao_oss: make error check slightly more correct
Only a return value of -1 indicates an error for open(), purely theoretically the mixer device could get 0 assigned as file descriptor. Even more theoretically, WinCE uses descriptors with values < 0, though that probably is non-conformant behaviour. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35295 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_oss.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c
index a79361a6a8..9d4dde4837 100644
--- a/libao2/ao_oss.c
+++ b/libao2/ao_oss.c
@@ -194,7 +194,7 @@ static int control(int cmd,void *arg){
if(AF_FORMAT_IS_AC3(ao_data.format))
return CONTROL_TRUE;
- if ((fd = open(oss_mixer_device, O_RDONLY)) > 0)
+ if ((fd = open(oss_mixer_device, O_RDONLY)) != -1)
{
ioctl(fd, SOUND_MIXER_READ_DEVMASK, &devs);
if (devs & (1 << oss_mixer_channel))