Enforce sample size alignment on first direct-copy channel.

This commit is contained in:
Ariff Abdullah 2007-03-18 18:26:40 +00:00
parent 64efc707cf
commit d5304d9e3d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167678

View file

@ -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;