Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amiga/dev round_blocksize must return a multiple of...



details:   https://anonhg.NetBSD.org/src/rev/4e13ced497e8
branches:  trunk
changeset: 745337:4e13ced497e8
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sat Feb 29 06:03:55 2020 +0000

description:
round_blocksize must return a multiple of the framesize.
aucc(4) supports 3 channels mode.

diffstat:

 sys/arch/amiga/dev/aucc.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r 2b298a64caa6 -r 4e13ced497e8 sys/arch/amiga/dev/aucc.c
--- a/sys/arch/amiga/dev/aucc.c Sat Feb 29 05:51:10 2020 +0000
+++ b/sys/arch/amiga/dev/aucc.c Sat Feb 29 06:03:55 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aucc.c,v 1.47 2019/09/07 11:57:08 rin Exp $ */
+/*     $NetBSD: aucc.c,v 1.48 2020/02/29 06:03:55 isaki Exp $ */
 
 /*
  * Copyright (c) 1999 Bernardo Innocenti
@@ -46,7 +46,7 @@
 #if NAUCC > 0
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aucc.c,v 1.47 2019/09/07 11:57:08 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aucc.c,v 1.48 2020/02/29 06:03:55 isaki Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -404,8 +404,11 @@
                     int mode, const audio_params_t *param)
 {
 
-       /* round up to even size */
-       return blk > AUDIO_BUF_SIZE ? AUDIO_BUF_SIZE : blk;
+       if (blk > AUDIO_BUF_SIZE)
+               blk = AUDIO_BUF_SIZE;
+
+       blk = rounddown(blk, param->channels * param->precision / NBBY);
+       return blk;
 }
 
 int



Home | Main Index | Thread Index | Old Index