summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2018-06-26 07:22:56 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2018-06-26 07:22:56 +0000
commit78d212a17e0e7e0791be7048d3ffeba7da5d6489 (patch)
tree6109b7c16637a94d96e207545e3f93bdc73412fa
parentb5640b499068cc03665578655d7ae66f13c8851a (diff)
Remove slot->maxweight, because it's a copy of opt->maxweight. Just
use the latter everywhere.
-rw-r--r--usr.bin/sndiod/dev.c9
-rw-r--r--usr.bin/sndiod/dev.h3
2 files changed, 5 insertions, 7 deletions
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 <alex@caoua.org>
*
@@ -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 <alex@caoua.org>
*
@@ -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 */