From 1ad5f3f0a40e1f1df82a2ea10efd8d074825b151 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 30 Oct 2012 17:36:41 +0000 Subject: 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 --- libao2/ao_oss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) -- cgit v1.2.3