summaryrefslogtreecommitdiffstats
path: root/libao2/ao_sun.c
diff options
context:
space:
mode:
authorjkeil <jkeil@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-29 08:47:30 +0000
committerjkeil <jkeil@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-29 08:47:30 +0000
commitee2ad205484898bc96b12964de2eb41c3c914bcb (patch)
treeac104d901e29ee5417ee9cd12b63d70ddf3dd819 /libao2/ao_sun.c
parentbd65848f567e0566cd20a620fc3e5d074bf079c7 (diff)
downloadmpv-ee2ad205484898bc96b12964de2eb41c3c914bcb.tar.bz2
mpv-ee2ad205484898bc96b12964de2eb41c3c914bcb.tar.xz
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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5894 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2/ao_sun.c')
-rw-r--r--libao2/ao_sun.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libao2/ao_sun.c b/libao2/ao_sun.c
index 16dbf23865..6f43343d5b 100644
--- a/libao2/ao_sun.c
+++ b/libao2/ao_sun.c
@@ -43,7 +43,7 @@ LIBAO_EXTERN(sun)
#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 @@ static int init(int rate,int channels,int format,int flags){
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