Restore old compatibility of feeding directly into /dev/dsp at 8000 hz

while preserving the New World Order.

Discussed with:	[1] Michael W. Oliver <michael at gargantuan.com>
MFC after:	1 week

[1] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-January/003562.html
This commit is contained in:
Ariff Abdullah 2006-01-16 11:07:15 +00:00
parent 6e7b73e090
commit 2fd8d3d84e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154428

View File

@ -246,7 +246,8 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td)
return EBUSY;
}
/* got a channel, already locked for us */
if (chn_reset(rdch, fmt)) {
if (chn_reset(rdch, fmt) ||
(fmt && chn_setspeed(rdch, DSP_DEFAULT_SPEED))) {
pcm_chnrelease(rdch);
pcm_lock(d);
i_dev->si_drv1 = NULL;
@ -273,7 +274,8 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td)
if (!wrch)
error = EBUSY; /* XXX Right return code? */
else if (chn_reset(wrch, fmt))
else if (chn_reset(wrch, fmt) ||
(fmt && chn_setspeed(wrch, DSP_DEFAULT_SPEED)))
error = ENODEV;
if (error != 0) {