aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAriff Abdullah <ariff@FreeBSD.org>2007-03-18 18:26:40 +0000
committerAriff Abdullah <ariff@FreeBSD.org>2007-03-18 18:26:40 +0000
commitd5304d9e3da37457537c51958454fb20b867d98b (patch)
tree633e9715143bf8e306e9c2d0834c9f3a879f4ff2 /sys/dev
parent64efc707cf380495064ee4cdb93613b394c12ac8 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sound/pcm/vchan.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c
index b65b43ca407f..43b0bfe0afb7 100644
--- a/sys/dev/sound/pcm/vchan.c
+++ b/sys/dev/sound/pcm/vchan.c
@@ -229,18 +229,22 @@ feed_vchan(struct pcm_feeder *f, struct pcm_channel *c, uint8_t *b,
if ((ch->flags & CHN_F_MAPPED) && !(ch->flags & CHN_F_CLOSING))
sndbuf_acquire(ch->bufsoft, NULL,
sndbuf_getfree(ch->bufsoft));
- if (rcnt == 0)
+ if (rcnt == 0) {
rcnt = FEEDER_FEED(ch->feeder, ch, b, count,
- ch->bufsoft);
- else {
+ ch->bufsoft);
+ rcnt -= rcnt % sz;
+ mcnt = count - rcnt;
+ } else {
cnt = FEEDER_FEED(ch->feeder, ch, tmp, count,
ch->bufsoft);
cnt -= cnt % sz;
if (cnt != 0) {
- if (mcnt++ == 0 && rcnt < count)
+ if (mcnt != 0) {
memset(b + rcnt,
sndbuf_zerodata(f->desc->out),
- count - rcnt);
+ mcnt);
+ mcnt = 0;
+ }
cnt = info->mix(b, tmp, cnt);
if (cnt > rcnt)
rcnt = cnt;