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

View File

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