Source-Changes-HG archive

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

[src/netbsd-8]: src Pull up following revision(s) (requested by isaki in tick...



details:   https://anonhg.NetBSD.org/src/rev/6d17a85019f2
branches:  netbsd-8
changeset: 852257:6d17a85019f2
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Feb 09 14:43:07 2019 +0000

description:
Pull up following revision(s) (requested by isaki in ticket #1185):

        lib/libossaudio/ossaudio.c: revision 1.35
        sys/compat/ossaudio/ossaudio.c: revision 1.71

Revert a wrong SNDCTL_DSP_GETOSPACE part of rev1.33.
- 'fragments' is the number of full free blocks and should not be
  negative value.
- 'bytes' should not be rounded down.

It makes mpv work correctly (fixes a second half of kern/53028).
Reviewed by mlelstv@

 -

Revert a wrong OSS_SNDCTL_DSP_GETOSPACE part of rev1.70.
- 'fragments' is the number of full free blocks and should not be
  negative value.
- 'bytes' should not be rounded down.

diffstat:

 lib/libossaudio/ossaudio.c     |  12 ++++++------
 sys/compat/ossaudio/ossaudio.c |  11 ++++++-----
 2 files changed, 12 insertions(+), 11 deletions(-)

diffs (68 lines):

diff -r 7a09d82703bf -r 6d17a85019f2 lib/libossaudio/ossaudio.c
--- a/lib/libossaudio/ossaudio.c        Fri Feb 08 16:05:46 2019 +0000
+++ b/lib/libossaudio/ossaudio.c        Sat Feb 09 14:43:07 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ossaudio.c,v 1.33 2017/03/23 15:50:48 nat Exp $        */
+/*     $NetBSD: ossaudio.c,v 1.33.4.1 2019/02/09 14:43:07 martin Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: ossaudio.c,v 1.33 2017/03/23 15:50:48 nat Exp $");
+__RCSID("$NetBSD: ossaudio.c,v 1.33.4.1 2019/02/09 14:43:07 martin Exp $");
 
 /*
  * This is an OSS (Linux) sound API emulator.
@@ -411,11 +411,11 @@
                        return retval;
                setblocksize(fd, &tmpinfo);
                bufinfo.fragsize = tmpinfo.blocksize;
-               bufinfo.fragments = (tmpinfo.hiwat * tmpinfo.blocksize -
-                   (tmpinfo.play.seek + tmpinfo.blocksize -1)) /
-                   tmpinfo.blocksize;
+               bufinfo.fragments = tmpinfo.hiwat - (tmpinfo.play.seek
+                   + tmpinfo.blocksize - 1) / tmpinfo.blocksize;
                bufinfo.fragstotal = tmpinfo.hiwat;
-               bufinfo.bytes = bufinfo.fragments * tmpinfo.blocksize;
+               bufinfo.bytes = tmpinfo.hiwat * tmpinfo.blocksize
+                   - tmpinfo.play.seek;
                *(struct audio_buf_info *)argp = bufinfo;
                break;
        case SNDCTL_DSP_GETISPACE:
diff -r 7a09d82703bf -r 6d17a85019f2 sys/compat/ossaudio/ossaudio.c
--- a/sys/compat/ossaudio/ossaudio.c    Fri Feb 08 16:05:46 2019 +0000
+++ b/sys/compat/ossaudio/ossaudio.c    Sat Feb 09 14:43:07 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ossaudio.c,v 1.70 2017/03/24 14:32:29 nat Exp $        */
+/*     $NetBSD: ossaudio.c,v 1.70.6.1 2019/02/09 14:43:08 martin 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.70 2017/03/24 14:32:29 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.70.6.1 2019/02/09 14:43:08 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -619,11 +619,12 @@
                }
                setblocksize(fp, &tmpinfo);
                bufinfo.fragsize = tmpinfo.blocksize;
-               bufinfo.fragments = (tmpinfo.hiwat * tmpinfo.blocksize -
-                   (tmpinfo.play.seek + tmpinfo.blocksize -1)) /
+               bufinfo.fragments = tmpinfo.hiwat -
+                   (tmpinfo.play.seek + tmpinfo.blocksize - 1) /
                    tmpinfo.blocksize;
                bufinfo.fragstotal = tmpinfo.hiwat;
-               bufinfo.bytes = bufinfo.fragments * tmpinfo.blocksize;
+               bufinfo.bytes =
+                   tmpinfo.hiwat * tmpinfo.blocksize - tmpinfo.play.seek;
                error = copyout(&bufinfo, SCARG(uap, data), sizeof bufinfo);
                if (error) {
                        DPRINTF(("%s: SNDCTL_DSP_GETOSPACE = %d\n",



Home | Main Index | Thread Index | Old Index