From 78d212a17e0e7e0791be7048d3ffeba7da5d6489 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Tue, 26 Jun 2018 07:22:56 +0000 Subject: Remove slot->maxweight, because it's a copy of opt->maxweight. Just use the latter everywhere. --- usr.bin/sndiod/dev.c | 9 ++++----- usr.bin/sndiod/dev.h | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c index f6f74765b18..050171f4483 100644 --- a/usr.bin/sndiod/dev.c +++ b/usr.bin/sndiod/dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.c,v 1.37 2018/06/26 07:15:17 ratchov Exp $ */ +/* $OpenBSD: dev.c,v 1.38 2018/06/26 07:22:55 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * @@ -639,8 +639,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) { @@ -648,7 +648,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 @@ -1684,7 +1684,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; diff --git a/usr.bin/sndiod/dev.h b/usr.bin/sndiod/dev.h index d0f48eb7956..126cfcfd1a5 100644 --- a/usr.bin/sndiod/dev.h +++ b/usr.bin/sndiod/dev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.h,v 1.14 2018/06/26 07:15:17 ratchov Exp $ */ +/* $OpenBSD: dev.h,v 1.15 2018/06/26 07:22:55 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * @@ -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 */ -- cgit v1.2.3