[Mplayer-cvslog] CVS: main/libao2 ao_sun.c,1.15,1.16

Jürgen Keil jkeil at mplayerhq.hu
Mon Apr 29 10:47:43 CEST 2002


Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv20131

Modified Files:
	ao_sun.c 
Log Message:
Default to the mixer device matching the audio device used for audio output.
That is, if the user redirects audio to /dev/sound/1 with the AUDIODEV 
environment variable, use /dev/sound/1ctl as the mixer device.

When AUDIODEV is not set, the default for both devices is /dev/audio & 
/dev/audioctl.


Index: ao_sun.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sun.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ao_sun.c	27 Apr 2002 22:42:24 -0000	1.15
+++ ao_sun.c	29 Apr 2002 08:47:30 -0000	1.16
@@ -43,7 +43,7 @@
 #endif
 
 
-static char *sun_mixer_device="/dev/audioctl";
+static char *sun_mixer_device = NULL;
 static char *audio_dev = NULL;
 static int queued_bursts = 0;
 static int queued_samples = 0;
@@ -261,12 +261,17 @@
     audio_info_t info;
     int ok;
 
-    if(mixer_device)
-      sun_mixer_device=mixer_device;
-
     if (audio_dev == NULL) {
 	if ((audio_dev = getenv("AUDIODEV")) == NULL)
 	    audio_dev = "/dev/audio";
+    }
+
+    if (sun_mixer_device == NULL) {
+	if ((sun_mixer_device = mixer_device) == NULL) {
+	    sun_mixer_device = malloc(strlen(audio_dev) + 4);
+	    strcpy(sun_mixer_device, audio_dev);
+	    strcat(sun_mixer_device, "ctl");
+	}
     }
 
     if (ao_subdevice) audio_dev = ao_subdevice;




More information about the MPlayer-cvslog mailing list