mirror of https://github.com/ericonr/sndio.git
factor tests for f->opt->join flag, no behaviour change
This commit is contained in:
parent
489fe436c3
commit
0778d29b61
11
aucat/sock.c
11
aucat/sock.c
|
@ -530,6 +530,7 @@ void
|
|||
sock_attach(struct sock *f, int force)
|
||||
{
|
||||
struct abuf *rbuf, *wbuf;
|
||||
unsigned rch, wch;
|
||||
|
||||
rbuf = LIST_FIRST(&f->pipe.file.rproc->outs);
|
||||
wbuf = LIST_FIRST(&f->pipe.file.wproc->ins);
|
||||
|
@ -567,11 +568,13 @@ sock_attach(struct sock *f, int force)
|
|||
* because dev_xxx() functions are supposed to
|
||||
* work (i.e., not to crash)
|
||||
*/
|
||||
if (f->opt->join) {
|
||||
rch = f->opt->rpar.cmax - f->opt->rpar.cmin + 1;
|
||||
wch = f->opt->wpar.cmax - f->opt->wpar.cmin + 1;
|
||||
} else
|
||||
rch = wch = 0;
|
||||
dev_attach(f->dev, f->pipe.file.name, f->mode,
|
||||
rbuf, &f->rpar,
|
||||
f->opt->join ? f->opt->rpar.cmax - f->opt->rpar.cmin + 1 : 0,
|
||||
wbuf, &f->wpar,
|
||||
f->opt->join ? f->opt->wpar.cmax - f->opt->wpar.cmin + 1 : 0,
|
||||
rbuf, &f->rpar, rch, wbuf, &f->wpar, wch,
|
||||
f->xrun, f->opt->maxweight);
|
||||
if (f->mode & MODE_PLAY)
|
||||
dev_setvol(f->dev, rbuf, MIDI_TO_ADATA(f->vol));
|
||||
|
|
Loading…
Reference in New Issue