PERFORCE change 153528 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Tue Nov 25 07:17:57 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=153528
Change 153528 by hselasky at hselasky_laptop001 on 2008/11/25 15:16:56
Make sure that the blocksize is a factor of the number of bytes
we insert per isochronous frame.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb2/sound/uaudio2.c#18 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb2/sound/uaudio2.c#18 (text+ko) ====
@@ -1067,6 +1067,10 @@
sample_size = ((chan->p_asf1d->bNrChannels *
chan->p_asf1d->bBitResolution) / 8);
+ /*
+ * NOTE: "chan->bytes_per_frame"
+ * should not be zero!
+ */
chan->bytes_per_frame = ((rate / fps) * sample_size);
if (sc->sc_sndstat_valid) {
@@ -1432,6 +1436,16 @@
RANGE(blocksize, 128, max / 2);
+ /*
+ * Make sure that the blocksize is a factor of the number of bytes
+ * we insert per isochronous frame.
+ */
+ blocksize += (ch->bytes_per_frame - blocksize) % ch->bytes_per_frame;
+ if (blocksize > (max / 2)) {
+ /* should not happen */
+ DPRINTFN(0, "blocksize overflow!\n");
+ blocksize = (max / 2);
+ }
blockcount = max / blocksize;
RANGE(blockcount, 2, 512);
More information about the p4-projects
mailing list