Fixed snd_*_card() wrt aserver

This commit is contained in:
Abramo Bagnara 2000-12-23 16:13:38 +00:00
parent 80c3adaace
commit c1ad051636
7 changed files with 38 additions and 48 deletions

View file

@ -668,10 +668,10 @@ int snd_pcm_open(snd_pcm_t **pcmp, char *name,
err = sscanf(name, "plug:%d,%d", &card, &dev);
if (err == 2)
return snd_pcm_plug_open_hw(pcmp, name, card, dev, -1, stream, mode);
err = sscanf(name, "shm:%256s,%256s", socket, sname);
err = sscanf(name, "shm:%256[^,],%256[^,]", socket, sname);
if (err == 2)
return snd_pcm_shm_open(pcmp, NULL, socket, sname, stream, mode);
err = sscanf(name, "file:%256s,%16s", file, format);
err = sscanf(name, "file:%256[^,],%16[^,]", file, format);
if (err == 2) {
snd_pcm_t *slave;
err = snd_pcm_null_open(&slave, NULL, stream, mode);
@ -679,7 +679,7 @@ int snd_pcm_open(snd_pcm_t **pcmp, char *name,
return err;
return snd_pcm_file_open(pcmp, NULL, file, -1, format, slave, 1);
}
err = sscanf(name, "file:%256s", file);
err = sscanf(name, "file:%256[^,]", file);
if (err == 1) {
snd_pcm_t *slave;
err = snd_pcm_null_open(&slave, NULL, stream, mode);

View file

@ -120,12 +120,8 @@ static int snd_pcm_shm_card(snd_pcm_t *pcm)
{
snd_pcm_shm_t *shm = pcm->private;
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
int err;
ctrl->cmd = SND_PCM_IOCTL_CARD;
err = snd_pcm_shm_action(pcm);
if (err < 0)
return err;
return ctrl->u.card;
return snd_pcm_shm_action(pcm);
}
static int snd_pcm_shm_nonblock(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int nonblock ATTRIBUTE_UNUSED)