mirror of https://github.com/mpv-player/mpv
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
This commit is contained in:
parent
3bebbe066d
commit
1ad5f3f0a4
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue