Source-Changes-HG archive

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

[src/trunk]: src Fix minor bugs of SNDCTL_DSP_GETISPACE.



details:   https://anonhg.NetBSD.org/src/rev/652442687ccc
branches:  trunk
changeset: 448415:652442687ccc
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sat Feb 02 04:52:16 2019 +0000

description:
Fix minor bugs of SNDCTL_DSP_GETISPACE.
- hiwat is playback-only parameter.
- 'bytes' should not be rounded down.

diffstat:

 lib/libossaudio/ossaudio.c     |  9 +++++----
 sys/compat/ossaudio/ossaudio.c |  9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diffs (60 lines):

diff -r 2c2aebb1cdff -r 652442687ccc lib/libossaudio/ossaudio.c
--- a/lib/libossaudio/ossaudio.c        Sat Feb 02 01:13:18 2019 +0000
+++ b/lib/libossaudio/ossaudio.c        Sat Feb 02 04:52:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ossaudio.c,v 1.35 2019/01/29 11:54:02 isaki Exp $      */
+/*     $NetBSD: ossaudio.c,v 1.36 2019/02/02 04:52:16 isaki Exp $      */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: ossaudio.c,v 1.35 2019/01/29 11:54:02 isaki Exp $");
+__RCSID("$NetBSD: ossaudio.c,v 1.36 2019/02/02 04:52:16 isaki Exp $");
 
 /*
  * This is an OSS (Linux) sound API emulator.
@@ -425,8 +425,9 @@
                setblocksize(fd, &tmpinfo);
                bufinfo.fragsize = tmpinfo.blocksize;
                bufinfo.fragments = tmpinfo.record.seek / tmpinfo.blocksize;
-               bufinfo.fragstotal = tmpinfo.hiwat;
-               bufinfo.bytes = bufinfo.fragments * tmpinfo.blocksize;
+               bufinfo.fragstotal =
+                   tmpinfo.record.buffer_size / tmpinfo.blocksize;
+               bufinfo.bytes = tmpinfo.record.seek;
                *(struct audio_buf_info *)argp = bufinfo;
                break;
        case SNDCTL_DSP_NONBLOCK:
diff -r 2c2aebb1cdff -r 652442687ccc sys/compat/ossaudio/ossaudio.c
--- a/sys/compat/ossaudio/ossaudio.c    Sat Feb 02 01:13:18 2019 +0000
+++ b/sys/compat/ossaudio/ossaudio.c    Sat Feb 02 04:52:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ossaudio.c,v 1.71 2019/01/29 12:01:20 isaki Exp $      */
+/*     $NetBSD: ossaudio.c,v 1.72 2019/02/02 04:52:16 isaki Exp $      */
 
 /*-
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.71 2019/01/29 12:01:20 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.72 2019/02/02 04:52:16 isaki Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -642,8 +642,9 @@
                setblocksize(fp, &tmpinfo);
                bufinfo.fragsize = tmpinfo.blocksize;
                bufinfo.fragments = tmpinfo.record.seek / tmpinfo.blocksize;
-               bufinfo.fragstotal = tmpinfo.hiwat;
-               bufinfo.bytes = bufinfo.fragments * tmpinfo.blocksize;
+               bufinfo.fragstotal =
+                   tmpinfo.record.buffer_size / tmpinfo.blocksize;
+               bufinfo.bytes = tmpinfo.record.seek;
                error = copyout(&bufinfo, SCARG(uap, data), sizeof bufinfo);
                if (error) {
                        DPRINTF(("%s: SNDCTL_DSP_GETISPACE %d %d %d %d = %d\n",



Home | Main Index | Thread Index | Old Index