pkgsrc-Changes archive

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

CVS commit: pkgsrc/devel/SDL2



Module Name:    pkgsrc
Committed By:   nia
Date:           Wed Apr  8 14:41:33 UTC 2020

Modified Files:
        pkgsrc/devel/SDL2: Makefile distinfo
        pkgsrc/devel/SDL2/patches: patch-src_audio_netbsd_SDL__netbsdaudio.c

Log Message:
SDL2: Update SDL_netbsdaudio to use the device's preferred sample rate.

This should allow for higher quality sample rate conversion via
libsamplerate in userspace.

Sent upstream.

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 pkgsrc/devel/SDL2/Makefile
cvs rdiff -u -r1.40 -r1.41 pkgsrc/devel/SDL2/distinfo
cvs rdiff -u -r1.4 -r1.5 \
    pkgsrc/devel/SDL2/patches/patch-src_audio_netbsd_SDL__netbsdaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/SDL2/Makefile
diff -u pkgsrc/devel/SDL2/Makefile:1.48 pkgsrc/devel/SDL2/Makefile:1.49
--- pkgsrc/devel/SDL2/Makefile:1.48     Sun Apr  5 16:22:42 2020
+++ pkgsrc/devel/SDL2/Makefile  Wed Apr  8 14:41:33 2020
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.48 2020/04/05 16:22:42 nia Exp $
+# $NetBSD: Makefile,v 1.49 2020/04/08 14:41:33 nia Exp $
 
 DISTNAME=      SDL2-2.0.12
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    devel
 MASTER_SITES=  https://www.libsdl.org/release/
 

Index: pkgsrc/devel/SDL2/distinfo
diff -u pkgsrc/devel/SDL2/distinfo:1.40 pkgsrc/devel/SDL2/distinfo:1.41
--- pkgsrc/devel/SDL2/distinfo:1.40     Sun Apr  5 16:24:28 2020
+++ pkgsrc/devel/SDL2/distinfo  Wed Apr  8 14:41:33 2020
@@ -1,11 +1,11 @@
-$NetBSD: distinfo,v 1.40 2020/04/05 16:24:28 nia Exp $
+$NetBSD: distinfo,v 1.41 2020/04/08 14:41:33 nia Exp $
 
 SHA1 (SDL2-2.0.12.tar.gz) = e8ba91bf5eb438dbcf1fedf0530a1bcbe30d3bb6
 RMD160 (SDL2-2.0.12.tar.gz) = 0f2c979da6151b622a6445e7fc8d4e3ea8987105
 SHA512 (SDL2-2.0.12.tar.gz) = 3f1f04af0f3d9dda9c84a2e9274ae8d83ea0da3fc367970a820036cc4dc1dbf990cfc37e4975ae05f0b45a4ffa739c6c19e470c00bf3f2bce9b8b63717b8b317
 Size (SDL2-2.0.12.tar.gz) = 5720162 bytes
 SHA1 (patch-configure) = 3038dc62450f6b64197ee4aa42d8ec9518a608bd
-SHA1 (patch-src_audio_netbsd_SDL__netbsdaudio.c) = 2100f4259a0054730475cc2bf062771b093bd083
+SHA1 (patch-src_audio_netbsd_SDL__netbsdaudio.c) = 65076b6fd5ef43141df263a148d9c040232ef845
 SHA1 (patch-src_video_wayland_SDL__waylandevents.c) = 57e42371e072048e5b377aeb58bb1ffce72784f0
 SHA1 (patch-src_video_wayland_SDL__waylandevents__c.h) = 3a723a81f05052bd50e8cb1592ba747b5f59ea1a
 SHA1 (patch-src_video_wayland_SDL__waylandvideo.c) = 823e434710f8b946b13ea7a6751cf1c30ec48600

Index: pkgsrc/devel/SDL2/patches/patch-src_audio_netbsd_SDL__netbsdaudio.c
diff -u pkgsrc/devel/SDL2/patches/patch-src_audio_netbsd_SDL__netbsdaudio.c:1.4 pkgsrc/devel/SDL2/patches/patch-src_audio_netbsd_SDL__netbsdaudio.c:1.5
--- pkgsrc/devel/SDL2/patches/patch-src_audio_netbsd_SDL__netbsdaudio.c:1.4     Sun Apr  5 16:22:42 2020
+++ pkgsrc/devel/SDL2/patches/patch-src_audio_netbsd_SDL__netbsdaudio.c Wed Apr  8 14:41:33 2020
@@ -1,10 +1,40 @@
-$NetBSD: patch-src_audio_netbsd_SDL__netbsdaudio.c,v 1.4 2020/04/05 16:22:42 nia Exp $
+$NetBSD: patch-src_audio_netbsd_SDL__netbsdaudio.c,v 1.5 2020/04/08 14:41:33 nia Exp $
 
+Use the preferred hardware sample rate
+https://bugzilla.libsdl.org/show_bug.cgi?id=5080
+
+Support 32-bit LPCM
 https://bugzilla.libsdl.org/show_bug.cgi?id=5076
 
 --- src/audio/netbsd/SDL_netbsdaudio.c.orig    2020-03-11 01:36:18.000000000 +0000
 +++ src/audio/netbsd/SDL_netbsdaudio.c
-@@ -261,6 +261,14 @@ NETBSDAUDIO_OpenDevice(_THIS, void *hand
+@@ -205,7 +205,7 @@ static int
+ NETBSDAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
+ {
+     SDL_AudioFormat format = 0;
+-    audio_info_t info;
++    audio_info_t info, hwinfo;
+     struct audio_prinfo *prinfo = iscapture ? &info.record : &info.play;
+ 
+     /* We don't care what the devname is...we'll try to open anything. */
+@@ -232,8 +232,16 @@ NETBSDAUDIO_OpenDevice(_THIS, void *hand
+     }
+ 
+     AUDIO_INITINFO(&info);
++    AUDIO_INITINFO(&hwinfo);
++
++    if (ioctl(this->hidden->audio_fd, AUDIO_GETFORMAT, &hwinfo) == -1) {
++        return SDL_SetError("Couldn't get device format %s: %s", devname, strerror(errno));
++    }
+ 
+     prinfo->encoding = AUDIO_ENCODING_NONE;
++    prinfo->channels = this->spec.channels;
++    prinfo->sample_rate = this->spec.freq = iscapture ?
++        hwinfo.record.sample_rate : hwinfo.play.sample_rate;
+ 
+     for (format = SDL_FirstAudioFormat(this->spec.format); format;) {
+         switch (format) {
+@@ -261,6 +269,14 @@ NETBSDAUDIO_OpenDevice(_THIS, void *hand
              prinfo->encoding = AUDIO_ENCODING_ULINEAR_BE;
              prinfo->precision = 16;
              break;
@@ -19,3 +49,28 @@ https://bugzilla.libsdl.org/show_bug.cgi
          }
          if (prinfo->encoding != AUDIO_ENCODING_NONE) {
              break;
+@@ -274,21 +290,18 @@ NETBSDAUDIO_OpenDevice(_THIS, void *hand
+ 
+     this->spec.format = format;
+ 
+-    /* Calculate spec parameters based on our chosen format */
+-    SDL_CalculateAudioSpec(&this->spec);
+-
+     info.mode = iscapture ? AUMODE_RECORD : AUMODE_PLAY;
+-    info.blocksize = this->spec.size;
+     info.hiwat = 5;
+     info.lowat = 3;
+-    prinfo->sample_rate = this->spec.freq;
+-    prinfo->channels = this->spec.channels;
+     (void) ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info);
+ 
+     (void) ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info);
+     this->spec.freq = prinfo->sample_rate;
+     this->spec.channels = prinfo->channels;
+ 
++    /* Calculate spec parameters based on our chosen format */
++    SDL_CalculateAudioSpec(&this->spec);
++
+     if (!iscapture) {
+         /* Allocate mixing buffer */
+         this->hidden->mixlen = this->spec.size;



Home | Main Index | Thread Index | Old Index