pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel/SDL2 SDL2: Update SDL_netbsdaudio to use the dev...
details: https://anonhg.NetBSD.org/pkgsrc/rev/6f6ff6848c0d
branches: trunk
changeset: 426929:6f6ff6848c0d
user: nia <nia%pkgsrc.org@localhost>
date: Wed Apr 08 14:41:33 2020 +0000
description:
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.
diffstat:
devel/SDL2/Makefile | 4 +-
devel/SDL2/distinfo | 4 +-
devel/SDL2/patches/patch-src_audio_netbsd_SDL__netbsdaudio.c | 59 +++++++++++-
3 files changed, 61 insertions(+), 6 deletions(-)
diffs (105 lines):
diff -r af0435655f37 -r 6f6ff6848c0d devel/SDL2/Makefile
--- a/devel/SDL2/Makefile Wed Apr 08 13:40:10 2020 +0000
+++ b/devel/SDL2/Makefile Wed Apr 08 14:41:33 2020 +0000
@@ -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/
diff -r af0435655f37 -r 6f6ff6848c0d devel/SDL2/distinfo
--- a/devel/SDL2/distinfo Wed Apr 08 13:40:10 2020 +0000
+++ b/devel/SDL2/distinfo Wed Apr 08 14:41:33 2020 +0000
@@ -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
diff -r af0435655f37 -r 6f6ff6848c0d devel/SDL2/patches/patch-src_audio_netbsd_SDL__netbsdaudio.c
--- a/devel/SDL2/patches/patch-src_audio_netbsd_SDL__netbsdaudio.c Wed Apr 08 13:40:10 2020 +0000
+++ b/devel/SDL2/patches/patch-src_audio_netbsd_SDL__netbsdaudio.c Wed Apr 08 14:41:33 2020 +0000
@@ -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 @@
}
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