mirror of https://github.com/ericonr/sndio.git
sndiod: simplify client rate boundary checks
This commit is contained in:
parent
99357b1841
commit
ee3ef94d5a
|
@ -626,7 +626,7 @@ sock_setpar(struct sock *f)
|
|||
if (AMSG_ISSET(rchan) && (s->mode & MODE_RECMASK)) {
|
||||
if (rchan < 1)
|
||||
rchan = 1;
|
||||
if (rchan > NCHAN_MAX)
|
||||
else if (rchan > NCHAN_MAX)
|
||||
rchan = NCHAN_MAX;
|
||||
s->sub.slot_cmin = f->opt->rmin;
|
||||
s->sub.slot_cmax = f->opt->rmin + rchan - 1;
|
||||
|
@ -650,7 +650,7 @@ sock_setpar(struct sock *f)
|
|||
if (AMSG_ISSET(pchan) && (s->mode & MODE_PLAY)) {
|
||||
if (pchan < 1)
|
||||
pchan = 1;
|
||||
if (pchan > NCHAN_MAX)
|
||||
else if (pchan > NCHAN_MAX)
|
||||
pchan = NCHAN_MAX;
|
||||
s->mix.slot_cmin = f->opt->pmin;
|
||||
s->mix.slot_cmax = f->opt->pmin + pchan - 1;
|
||||
|
@ -674,7 +674,7 @@ sock_setpar(struct sock *f)
|
|||
if (AMSG_ISSET(rate)) {
|
||||
if (rate < RATE_MIN)
|
||||
rate = RATE_MIN;
|
||||
if (rate > RATE_MAX)
|
||||
else if (rate > RATE_MAX)
|
||||
rate = RATE_MAX;
|
||||
s->round = dev_roundof(d, rate);
|
||||
s->rate = rate;
|
||||
|
|
Loading…
Reference in New Issue