aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOrion Hodson <orion@FreeBSD.org>2003-02-03 15:02:28 +0000
committerOrion Hodson <orion@FreeBSD.org>2003-02-03 15:02:28 +0000
commitfaea6799307ef5abf7795b0dd57736c008b200c0 (patch)
tree5fc0bcc31c39fd0767a51b9e051e69b5f432c2da
parent411c25edaea6d45669dfaca9b8a7c30f57cc0cb8 (diff)
downloadsrc-faea6799307ef5abf7795b0dd57736c008b200c0.tar.gz
src-faea6799307ef5abf7795b0dd57736c008b200c0.zip
Avoid zero padding when feeding read channels. chn_rdfeed has no way
of knowing data size transformations of feeder chain and in some cases this means too much data is pulled through chain, eg converting input stream from 16bits to 8bits on 16bit only h/w. PR: kern/37831 Submitted by: Harti Brandt <brandt@fokus.fraunhofer.de>
Notes
Notes: svn path=/head/; revision=110287
-rw-r--r--sys/dev/sound/pcm/feeder.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c
index 0edb34fb6e5f..915111a660b2 100644
--- a/sys/dev/sound/pcm/feeder.c
+++ b/sys/dev/sound/pcm/feeder.c
@@ -388,6 +388,10 @@ feed_root(struct pcm_feeder *feeder, struct pcm_channel *ch, u_int8_t *buffer, u
l = min(count, sndbuf_getready(src));
sndbuf_dispose(src, buffer, l);
+ /* When recording only return as much data as available */
+ if (ch->direction == PCMDIR_REC)
+ return l;
+
/*
if (l < count)
printf("appending %d bytes\n", count - l);