summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>2002-01-23 05:35:12 +0000
committercg <cg@FreeBSD.org>2002-01-23 05:35:12 +0000
commitf83c1aa29beb2fe5359a1f893cd7a2f059767415 (patch)
tree996a2439691204540809c671baf6764d97a44769 /sys
parent505a32c5daf85f50f560ecce7803988370e53eb8 (diff)
downloadFreeBSD-src-f83c1aa29beb2fe5359a1f893cd7a2f059767415.zip
FreeBSD-src-f83c1aa29beb2fe5359a1f893cd7a2f059767415.tar.gz
set the speeds the right way round for recording using the rate feeder
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sound/pcm/channel.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 5a8fb1c..63cd94e 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -788,6 +788,7 @@ chn_tryspeed(struct pcm_channel *c, int speed)
struct pcm_feeder *f;
struct snd_dbuf *b = c->bufhard;
struct snd_dbuf *bs = c->bufsoft;
+ struct snd_dbuf *x;
int r, delta;
CHN_LOCKASSERT(c);
@@ -832,13 +833,15 @@ chn_tryspeed(struct pcm_channel *c, int speed)
if (f == NULL)
goto out;
- r = FEEDER_SET(f, FEEDRATE_SRC, sndbuf_getspd(bs));
- DEB(printf("feeder_set(FEEDRATE_SRC, %d) = %d\n", sndbuf_getspd(bs), r));
+ x = (c->direction == PCMDIR_REC)? b : bs;
+ r = FEEDER_SET(f, FEEDRATE_SRC, sndbuf_getspd(x));
+ DEB(printf("feeder_set(FEEDRATE_SRC, %d) = %d\n", sndbuf_getspd(x), r));
if (r)
goto out;
- r = FEEDER_SET(f, FEEDRATE_DST, sndbuf_getspd(b));
- DEB(printf("feeder_set(FEEDRATE_DST, %d) = %d\n", sndbuf_getspd(b), r));
+ x = (c->direction == PCMDIR_REC)? bs : b;
+ r = FEEDER_SET(f, FEEDRATE_DST, sndbuf_getspd(x));
+ DEB(printf("feeder_set(FEEDRATE_DST, %d) = %d\n", sndbuf_getspd(x), r));
out:
DEB(printf("setspeed done, r = %d\n", r));
return r;
OpenPOWER on IntegriCloud