summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authororion <orion@FreeBSD.org>2003-02-03 15:02:28 +0000
committerorion <orion@FreeBSD.org>2003-02-03 15:02:28 +0000
commit658f4bf358e436b44e6d53890d6c9d192ace524b (patch)
tree5fc0bcc31c39fd0767a51b9e051e69b5f432c2da
parent7fd7c82761afb4df360e6732570c65665fe5208e (diff)
downloadFreeBSD-src-658f4bf358e436b44e6d53890d6c9d192ace524b.zip
FreeBSD-src-658f4bf358e436b44e6d53890d6c9d192ace524b.tar.gz
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>
-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 0edb34f..915111a 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);
OpenPOWER on IntegriCloud