diff options
Diffstat (limited to 'sys/dev/sound/dummy.c')
| -rw-r--r-- | sys/dev/sound/dummy.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c index 4df5b112d3f4..39214a141bf9 100644 --- a/sys/dev/sound/dummy.c +++ b/sys/dev/sound/dummy.c @@ -104,9 +104,10 @@ dummy_chan_io(void *arg) ch = &sc->chans[i]; if (!ch->run) continue; - if (ch->dir == PCMDIR_PLAY) + if (ch->dir == PCMDIR_PLAY) { ch->ptr += sndbuf_getblksz(ch->buf); - else + ch->ptr %= sndbuf_getsize(ch->buf); + } else sndbuf_fillsilence(ch->buf); snd_mtxunlock(sc->lock); chn_intr(ch->chan); @@ -346,6 +347,12 @@ dummy_attach(device_t dev) return (ENXIO); mixer_init(dev, &dummy_mixer_class, sc); + /* + * Create an alias so that tests do not need to guess which one is the + * dummy device if there are more devices present in the system. + */ + make_dev_alias(sc->info.dsp_dev, "dsp.dummy"); + return (0); } |
