Module Name: src
Committed By: nat
Date: Tue Oct 31 21:18:02 UTC 2017
Modified Files:
src/sys/dev: audio.c
Log Message:
Only allow blocksizes greater or equal to the calculated one.
This should help applications as the blocksize obtained (AUDIO_SET/GETINFO)
will work without stutter.
Ok christos@.
To generate a diff of this commit:
cvs rdiff -u -r1.420 -r1.421 src/sys/dev/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/audio.c
diff -u src/sys/dev/audio.c:1.420 src/sys/dev/audio.c:1.421
--- src/sys/dev/audio.c:1.420 Tue Oct 31 21:13:24 2017
+++ src/sys/dev/audio.c Tue Oct 31 21:18:02 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.420 2017/10/31 21:13:24 nat Exp $ */
+/* $NetBSD: audio.c,v 1.421 2017/10/31 21:18:02 nat Exp $ */
/*-
* Copyright (c) 2016 Nathanial Sloss <[email protected]>
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.420 2017/10/31 21:13:24 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.421 2017/10/31 21:18:02 nat Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -2689,11 +2689,9 @@ audio_setblksize(struct audio_softc *sc,
mixcb->blksize = audio_calc_blksize(sc, parm);
cb->blksize = audio_calc_blksize(sc, &cb->s.param);
} else {
- if (SPECIFIED(blksize))
+ cb->blksize = audio_calc_blksize(sc, &stream->param);
+ if (SPECIFIED(blksize) && blksize > cb->blksize)
cb->blksize = blksize;
- else {
- cb->blksize = audio_calc_blksize(sc, &stream->param);
- }
}
}