fix SNDCTL_DSP_GETODELAY

PR:		kern/20340
Submitted by:	Takashi SHIRAI <shirai@nintendo.co.jp>
This commit is contained in:
Cameron Grant 2000-08-19 18:29:46 +00:00
parent 4e77c04865
commit fa06efc7e6

View File

@ -587,12 +587,13 @@ dsp_ioctl(snddev_info *d, int chan, u_long cmd, caddr_t arg)
case SNDCTL_DSP_GETODELAY:
if (wrch) {
snd_dbuf *b = &wrch->buffer;
snd_dbuf *bs = &wrch->buffer2nd;
if (b->dl) {
chn_checkunderflow(wrch);
if (!(wrch->flags & CHN_F_MAPPED))
while (chn_wrfeed(wrch) > 0);
}
*arg = b->total;
*arg_i = b->rl + bs->rl;
} else
ret = EINVAL;
break;