some code cleanup

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@513 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
pontscho 2001-04-18 20:39:04 +00:00
parent 2fa840b338
commit 05d3596822
1 changed files with 2 additions and 11 deletions

13
mixer.c
View File

@ -7,20 +7,14 @@
#include "mixer.h" #include "mixer.h"
#define DEV_MIXER "/dev/mixer"
char * mixer_device=NULL; char * mixer_device=NULL;
char * devname=NULL;
int mixer_usemaster=0; int mixer_usemaster=0;
void mixer_getvolume( int *l,int *r ) void mixer_getvolume( int *l,int *r )
{ {
int fd,v,cmd,devs; int fd,v,cmd,devs;
if ( !mixer_device ) devname=strdup( DEV_MIXER ); fd=open( mixer_device,O_RDONLY );
else devname=strdup( mixer_device );
fd=open( devname,O_RDONLY );
free( devname );
if ( fd != -1 ) if ( fd != -1 )
{ {
ioctl( fd,SOUND_MIXER_READ_DEVMASK,&devs ); ioctl( fd,SOUND_MIXER_READ_DEVMASK,&devs );
@ -43,10 +37,7 @@ void mixer_setvolume( int l,int r )
{ {
int fd,v,cmd,devs; int fd,v,cmd,devs;
if ( !mixer_device ) devname=strdup( DEV_MIXER ); fd=open( mixer_device,O_RDONLY );
else devname=strdup( mixer_device );
fd=open( devname,O_RDONLY );
free( devname );
if ( fd != -1 ) if ( fd != -1 )
{ {
ioctl( fd,SOUND_MIXER_READ_DEVMASK,&devs ); ioctl( fd,SOUND_MIXER_READ_DEVMASK,&devs );