Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/audio allow for buffer sizes < 32k



details:   https://anonhg.NetBSD.org/src/rev/597ad1b68370
branches:  trunk
changeset: 760162:597ad1b68370
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Dec 29 14:38:54 2010 +0000

description:
allow for buffer sizes < 32k

diffstat:

 usr.bin/audio/play/play.c     |  11 ++++++-----
 usr.bin/audio/record/record.c |  11 ++++++-----
 2 files changed, 12 insertions(+), 10 deletions(-)

diffs (66 lines):

diff -r c2ce08aa03f5 -r 597ad1b68370 usr.bin/audio/play/play.c
--- a/usr.bin/audio/play/play.c Wed Dec 29 13:49:32 2010 +0000
+++ b/usr.bin/audio/play/play.c Wed Dec 29 14:38:54 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: play.c,v 1.51 2010/12/29 13:09:03 mrg Exp $    */
+/*     $NetBSD: play.c,v 1.52 2010/12/29 14:38:54 jmcneill Exp $       */
 
 /*
  * Copyright (c) 1999, 2000, 2001, 2002, 2010 Matthew R. Green
@@ -28,7 +28,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: play.c,v 1.51 2010/12/29 13:09:03 mrg Exp $");
+__RCSID("$NetBSD: play.c,v 1.52 2010/12/29 14:38:54 jmcneill Exp $");
 #endif
 
 
@@ -184,10 +184,11 @@
 
        if (ioctl(audiofd, AUDIO_GETINFO, &info) < 0)
                err(1, "failed to get audio info");
-       if (bufsize == 0)
+       if (bufsize == 0) {
                bufsize = info.play.buffer_size;
-       if (bufsize < 32 * 1024)
-               bufsize = 32 * 1024;
+               if (bufsize < 32 * 1024)
+                       bufsize = 32 * 1024;
+       }
 
        signal(SIGINT, cleanup);
        signal(SIGTERM, cleanup);
diff -r c2ce08aa03f5 -r 597ad1b68370 usr.bin/audio/record/record.c
--- a/usr.bin/audio/record/record.c     Wed Dec 29 13:49:32 2010 +0000
+++ b/usr.bin/audio/record/record.c     Wed Dec 29 14:38:54 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: record.c,v 1.48 2010/12/29 13:09:03 mrg Exp $  */
+/*     $NetBSD: record.c,v 1.49 2010/12/29 14:38:55 jmcneill Exp $     */
 
 /*
  * Copyright (c) 1999, 2002, 2003, 2005, 2010 Matthew R. Green
@@ -32,7 +32,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: record.c,v 1.48 2010/12/29 13:09:03 mrg Exp $");
+__RCSID("$NetBSD: record.c,v 1.49 2010/12/29 14:38:55 jmcneill Exp $");
 #endif
 
 
@@ -246,10 +246,11 @@
         */
        if (ioctl(audiofd, AUDIO_GETINFO, &oinfo) < 0)
                err(1, "failed to get audio info");
-       if (bufsize == 0)
+       if (bufsize == 0) {
                bufsize = oinfo.record.buffer_size;
-       if (bufsize < 32 * 1024)
-               bufsize = 32 * 1024;
+               if (bufsize < 32 * 1024)
+                       bufsize = 32 * 1024;
+       }
        omonitor_gain = oinfo.monitor_gain;
 
        buffer = malloc(bufsize);



Home | Main Index | Thread Index | Old Index