diff options
author | ariff <ariff@FreeBSD.org> | 2005-12-30 07:33:01 +0000 |
---|---|---|
committer | ariff <ariff@FreeBSD.org> | 2005-12-30 07:33:01 +0000 |
commit | 904d3f4de5eabd5a7ecb1f7fdc712b4ad55dec35 (patch) | |
tree | 13426f61615d375e6ac0758ac1b38ca08c49ac10 /sys | |
parent | 3c839b24894f7c9ee70a27e2e04b3f9100761c5a (diff) | |
download | FreeBSD-src-904d3f4de5eabd5a7ecb1f7fdc712b4ad55dec35.zip FreeBSD-src-904d3f4de5eabd5a7ecb1f7fdc712b4ad55dec35.tar.gz |
Underruns counting logic should be based on bufhard free space
and must be done after sndbuf_feed(), or any attempt to fill
up bufhard. This should fix false underruns counter.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sound/pcm/channel.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index be32d02..32cdf51 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -245,28 +245,12 @@ chn_wrfeed(struct pcm_channel *c) ("%s(%s): amt %d > source size %d, flags 0x%x", __func__, c->name, amt, sndbuf_getsize(bs), c->flags)); - if (SLIST_EMPTY(&c->children)) { - /* - * Hardware channel - */ - if (sndbuf_getready(bs) < amt) - c->xruns++; - ret = (amt > 0) ? sndbuf_feed(bs, b, c, c->feeder, amt) : ENOSPC; - } else { - /* - * vchan - */ - if (amt > 0) { - ret = sndbuf_feed(bs, b, c, c->feeder, amt); - /* - * Possible vchan xruns. There should be no empty space - * left in buffer. - */ - if (sndbuf_getfree(b) > 0) - c->xruns++; - } else - ret = ENOSPC; - } + ret = (amt > 0) ? sndbuf_feed(bs, b, c, c->feeder, amt) : ENOSPC; + /* + * Possible xruns. There should be no empty space left in buffer. + */ + if (sndbuf_getfree(b) > 0) + c->xruns++; if (ret == 0 && sndbuf_getfree(b) < amt) chn_wakeup(c); |