changeset 512:5cc44d8c20f2

some code cleanup
author pontscho
date Wed, 18 Apr 2001 20:39:04 +0000
parents e80c8abd26d1
children aec3cad1e41a
files mixer.c
diffstat 1 files changed, 2 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mixer.c	Wed Apr 18 20:38:03 2001 +0000
+++ b/mixer.c	Wed Apr 18 20:39:04 2001 +0000
@@ -7,20 +7,14 @@
 
 #include "mixer.h"
 
-#define DEV_MIXER "/dev/mixer"
-
 char * mixer_device=NULL;
-char * devname=NULL;
 int    mixer_usemaster=0;
 
 void mixer_getvolume( int *l,int *r )
 {
  int fd,v,cmd,devs;
 
- if ( !mixer_device ) devname=strdup( DEV_MIXER );
-   else devname=strdup( mixer_device );
- fd=open( devname,O_RDONLY );
- free( devname );
+ fd=open( mixer_device,O_RDONLY );
  if ( fd != -1 )
   {
    ioctl( fd,SOUND_MIXER_READ_DEVMASK,&devs );
@@ -43,10 +37,7 @@
 {
  int fd,v,cmd,devs;
 
- if ( !mixer_device ) devname=strdup( DEV_MIXER );
-   else devname=strdup( mixer_device );
- fd=open( devname,O_RDONLY );
- free( devname );
+ fd=open( mixer_device,O_RDONLY );
  if ( fd != -1 )
   {
    ioctl( fd,SOUND_MIXER_READ_DEVMASK,&devs );