Ported to alsa-lib changes

This commit is contained in:
Abramo Bagnara 2000-10-14 10:35:24 +00:00
parent 0f2eaba07a
commit 00cf60e11d
2 changed files with 6 additions and 5 deletions

View file

@ -424,7 +424,7 @@ static int get_controls(int cardno, snd_config_t *top)
snd_control_list_t list; snd_control_list_t list;
int idx, err; int idx, err;
err = snd_ctl_hw_open(&handle, cardno); err = snd_ctl_hw_open(&handle, NULL, cardno);
if (err < 0) { if (err < 0) {
error("snd_ctl_open error: %s", snd_strerror(err)); error("snd_ctl_open error: %s", snd_strerror(err));
return err; return err;
@ -852,7 +852,7 @@ static int set_controls(int card, snd_config_t *top)
snd_config_iterator_t i; snd_config_iterator_t i;
int err; int err;
err = snd_ctl_hw_open(&handle, card); err = snd_ctl_hw_open(&handle, NULL, card);
if (err < 0) { if (err < 0) {
error("snd_ctl_open error: %s", snd_strerror(err)); error("snd_ctl_open error: %s", snd_strerror(err));
return err; return err;

View file

@ -72,7 +72,6 @@ static int ready_mode = SND_PCM_READY_FRAGMENT;
static int open_mode = 0; static int open_mode = 0;
static int stream = SND_PCM_STREAM_PLAYBACK; static int stream = SND_PCM_STREAM_PLAYBACK;
static int mmap_flag = 0; static int mmap_flag = 0;
static char *mmap_data = NULL;
static int nonblock = 0; static int nonblock = 0;
static char *audiobuf = NULL; static char *audiobuf = NULL;
static int buffer_size = -1; static int buffer_size = -1;
@ -164,6 +163,7 @@ static void check_new_format(snd_pcm_format_t * format)
error("unsupported format %s", snd_pcm_format_name(format->sfmt)); error("unsupported format %s", snd_pcm_format_name(format->sfmt));
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#if 0
if (format->channels > 1) { if (format->channels > 1) {
if (xfer_mode == SND_PCM_XFER_INTERLEAVED) { if (xfer_mode == SND_PCM_XFER_INTERLEAVED) {
if (!(cpinfo.flags & SND_PCM_INFO_INTERLEAVED)) { if (!(cpinfo.flags & SND_PCM_INFO_INTERLEAVED)) {
@ -175,6 +175,7 @@ static void check_new_format(snd_pcm_format_t * format)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
#endif
} }
static void usage(char *command) static void usage(char *command)
@ -239,7 +240,7 @@ static void device_list(void)
for (card = 0; card < SND_CARDS; card++) { for (card = 0; card < SND_CARDS; card++) {
if (!(mask & (1 << card))) if (!(mask & (1 << card)))
continue; continue;
if ((err = snd_ctl_hw_open(&handle, card)) < 0) { if ((err = snd_ctl_hw_open(&handle, NULL, card)) < 0) {
error("control open (%i): %s", card, snd_strerror(err)); error("control open (%i): %s", card, snd_strerror(err));
continue; continue;
} }
@ -798,7 +799,7 @@ static void set_params(void)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (mmap_flag) { if (mmap_flag) {
if (snd_pcm_mmap(handle, (void **)&mmap_data)<0) { if (snd_pcm_mmap(handle)<0) {
error("unable to mmap memory"); error("unable to mmap memory");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }