use -mixer with alsa9

patch by Roland Kuhn <rkuhn@e18.physik.tu-muenchen.de>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11765 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
attila 2004-01-10 09:10:52 +00:00
parent 8e3155be87
commit c27b831927
2 changed files with 36 additions and 4 deletions

View File

@ -18,6 +18,7 @@
#include <sys/poll.h>
#include "../config.h"
#include "../mixer.h"
#if HAVE_SYS_ASOUNDLIB_H
#include <sys/asoundlib.h>
@ -96,13 +97,28 @@ static int control(int cmd, void *arg)
snd_mixer_elem_t *elem;
snd_mixer_selem_id_t *sid;
const char *mix_name = "PCM";
char *card = "default";
static const char *mix_name = NULL;
static char *card = NULL;
long pmin, pmax;
long get_vol, set_vol;
float calc_vol, diff, f_multi;
if(mix_name == NULL){
if(mixer_device) {
card = strdup(mixer_device);
mix_name = strchr(card, '/');
if(mix_name) {
*mix_name++ = 0;
} else {
mix_name = "PCM";
}
} else {
mix_name = "PCM";
card = "default";
}
}
if(ao_data.format == AFMT_AC3)
return CONTROL_TRUE;

View File

@ -18,6 +18,7 @@
#include <sys/poll.h>
#include "../config.h"
#include "../mixer.h"
#if HAVE_SYS_ASOUNDLIB_H
#include <sys/asoundlib.h>
@ -96,13 +97,28 @@ static int control(int cmd, void *arg)
snd_mixer_elem_t *elem;
snd_mixer_selem_id_t *sid;
const char *mix_name = "PCM";
char *card = "default";
static const char *mix_name = NULL;
static char *card = NULL;
long pmin, pmax;
long get_vol, set_vol;
float calc_vol, diff, f_multi;
if(mix_name == NULL){
if(mixer_device) {
card = strdup(mixer_device);
mix_name = strchr(card, '/');
if(mix_name) {
*mix_name++ = 0;
} else {
mix_name = "PCM";
}
} else {
mix_name = "PCM";
card = "default";
}
}
if(ao_data.format == AFMT_AC3)
return CONTROL_TRUE;