# HG changeset patch # User jkeil # Date 1020070050 0 # Node ID 6a6107da2d82f48f358e9395d2aba77d93620bc0 # Parent 2e71feda5e0f871af9c621d2ee37af99f24e5186 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. diff -r 2e71feda5e0f -r 6a6107da2d82 libao2/ao_sun.c --- a/libao2/ao_sun.c Sun Apr 28 22:37:35 2002 +0000 +++ b/libao2/ao_sun.c Mon Apr 29 08:47:30 2002 +0000 @@ -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,14 +261,19 @@ 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; if (enable_sample_timing == RTSC_UNKNOWN