comparison libao2/ao_alsa9.c @ 11764:129caea8bebc

use -mixer with alsa9 patch by Roland Kuhn <rkuhn@e18.physik.tu-muenchen.de>
author attila
date Sat, 10 Jan 2004 09:10:52 +0000
parents 6e35326c742f
children 48f1b211f43b
comparison
equal deleted inserted replaced
11763:053a82066c60 11764:129caea8bebc
16 #include <math.h> 16 #include <math.h>
17 #include <string.h> 17 #include <string.h>
18 #include <sys/poll.h> 18 #include <sys/poll.h>
19 19
20 #include "../config.h" 20 #include "../config.h"
21 #include "../mixer.h"
21 22
22 #if HAVE_SYS_ASOUNDLIB_H 23 #if HAVE_SYS_ASOUNDLIB_H
23 #include <sys/asoundlib.h> 24 #include <sys/asoundlib.h>
24 #elif HAVE_ALSA_ASOUNDLIB_H 25 #elif HAVE_ALSA_ASOUNDLIB_H
25 #include <alsa/asoundlib.h> 26 #include <alsa/asoundlib.h>
94 int err; 95 int err;
95 snd_mixer_t *handle; 96 snd_mixer_t *handle;
96 snd_mixer_elem_t *elem; 97 snd_mixer_elem_t *elem;
97 snd_mixer_selem_id_t *sid; 98 snd_mixer_selem_id_t *sid;
98 99
99 const char *mix_name = "PCM"; 100 static const char *mix_name = NULL;
100 char *card = "default"; 101 static char *card = NULL;
101 102
102 long pmin, pmax; 103 long pmin, pmax;
103 long get_vol, set_vol; 104 long get_vol, set_vol;
104 float calc_vol, diff, f_multi; 105 float calc_vol, diff, f_multi;
106
107 if(mix_name == NULL){
108 if(mixer_device) {
109 card = strdup(mixer_device);
110 mix_name = strchr(card, '/');
111 if(mix_name) {
112 *mix_name++ = 0;
113 } else {
114 mix_name = "PCM";
115 }
116 } else {
117 mix_name = "PCM";
118 card = "default";
119 }
120 }
105 121
106 if(ao_data.format == AFMT_AC3) 122 if(ao_data.format == AFMT_AC3)
107 return CONTROL_TRUE; 123 return CONTROL_TRUE;
108 124
109 //allocate simple id 125 //allocate simple id