Add audio controls in dev_open(), not dev_open_do()

This commit is contained in:
Alexandre Ratchov 2019-08-30 15:35:29 +02:00
parent e15f9cc366
commit a4ac7781fd
1 changed files with 25 additions and 25 deletions

View File

@ -1049,9 +1049,6 @@ dev_adjpar(struct dev *d, int mode,
int
dev_open_do(struct dev *d)
{
int i, gunit;
struct ctl *c;
if (!dev_sio_open(d)) {
if (log_level >= 1) {
dev_log(d);
@ -1113,6 +1110,31 @@ dev_open_do(struct dev *d)
log_putu(d->round);
log_puts(" frames\n");
}
return 1;
}
/*
* Reset parameters and open the device.
*/
int
dev_open(struct dev *d)
{
int i, gunit;
struct ctl *c;
d->mode = d->reqmode;
d->round = d->reqround;
d->bufsz = d->reqbufsz;
d->rate = d->reqrate;
d->pchan = d->reqpchan;
d->rchan = d->reqrchan;
d->par = d->reqpar;
if (d->pchan == 0)
d->pchan = 2;
if (d->rchan == 0)
d->rchan = 2;
if (!dev_open_do(d))
return 0;
/*
@ -1144,28 +1166,6 @@ dev_open_do(struct dev *d)
return 1;
}
/*
* Reset parameters and open the device.
*/
int
dev_open(struct dev *d)
{
d->mode = d->reqmode;
d->round = d->reqround;
d->bufsz = d->reqbufsz;
d->rate = d->reqrate;
d->pchan = d->reqpchan;
d->rchan = d->reqrchan;
d->par = d->reqpar;
if (d->pchan == 0)
d->pchan = 2;
if (d->rchan == 0)
d->rchan = 2;
if (!dev_open_do(d))
return 0;
return 1;
}
/*
* Force all slots to exit
*/