sndiod: Use opt->maxweight and remove slot->maxweight.

This commit is contained in:
Alexandre Ratchov 2018-06-11 19:53:07 +02:00
parent e20bc384e3
commit 9eef11f53b
2 changed files with 3 additions and 5 deletions

View File

@ -640,8 +640,8 @@ dev_mix_adjvol(struct dev *d)
}
weight /= n;
}
if (weight > i->mix.maxweight)
weight = i->mix.maxweight;
if (weight > i->opt->maxweight)
weight = i->opt->maxweight;
i->mix.weight = ADATA_MUL(weight, MIDI_TO_ADATA(d->master));
#ifdef DEBUG
if (log_level >= 3) {
@ -649,7 +649,7 @@ dev_mix_adjvol(struct dev *d)
log_puts(": set weight: ");
log_puti(i->mix.weight);
log_puts("/");
log_puti(i->mix.maxweight);
log_puti(i->opt->maxweight);
log_puts("\n");
}
#endif
@ -1685,7 +1685,6 @@ found:
s->xrun = XRUN_IGNORE;
s->tstate = MMC_OFF;
}
s->mix.maxweight = s->opt->maxweight;
s->dup = s->opt->dup;
s->appbufsz = d->bufsz;
s->round = d->round;

View File

@ -44,7 +44,6 @@ struct slot {
struct aparams par; /* socket side params */
struct {
int weight; /* dynamic range */
int maxweight; /* max dynamic range allowed */
unsigned int vol; /* volume within the vol */
struct abuf buf; /* socket side buffer */
int bpf; /* byte per frame */