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)
This commit is contained in:
matk 2004-01-20 05:30:09 +00:00
parent 09543443a7
commit 1d6b947293

View File

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