diff options
author | matk <matk@FreeBSD.org> | 2004-01-20 05:30:09 +0000 |
---|---|---|
committer | matk <matk@FreeBSD.org> | 2004-01-20 05:30:09 +0000 |
commit | 1d6b947293009c8f77245b23428e66bf67d8289d (patch) | |
tree | ac5a5da8a38b72866df462fdb93b067a28aa42e5 /sys/dev | |
parent | 09543443a714bcb69a302ce1b2e131fe06ded6d7 (diff) | |
download | FreeBSD-src-1d6b947293009c8f77245b23428e66bf67d8289d.zip FreeBSD-src-1d6b947293009c8f77245b23428e66bf67d8289d.tar.gz |
Reduce latency when using the SNDCTL_DSP_RESET ioctl by calling
chn_resetbuf().
Submited by: Pyun YongHyeon <yongari@kt-is.co.kr>
Approved by: tanimura (mentor)
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/sound/pcm/dsp.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 546041b..1bff663 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -660,10 +660,18 @@ dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td) case SNDCTL_DSP_RESET: DEB(printf("dsp reset\n")); - if (wrch) + if (wrch) { + CHN_LOCK(wrch); chn_abort(wrch); - if (rdch) + chn_resetbuf(wrch); + CHN_UNLOCK(wrch); + } + if (rdch) { + CHN_LOCK(rdch); chn_abort(rdch); + chn_resetbuf(rdch); + CHN_UNLOCK(rdch); + } break; case SNDCTL_DSP_SYNC: |