pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel/SDL2 check return value of ioctl() and return an...
details: https://anonhg.NetBSD.org/pkgsrc/rev/31bf573d76d4
branches: trunk
changeset: 448555:31bf573d76d4
user: mrg <mrg%pkgsrc.org@localhost>
date: Tue Mar 09 20:41:08 2021 +0000
description:
check return value of ioctl() and return an error if it fails.
stops mpv continuing thinking it has a valid setup audio
device that makes it seem to have hung.
bump pkg version.
diffstat:
devel/SDL2/Makefile | 4 +-
devel/SDL2/distinfo | 3 +-
devel/SDL2/patches/patch-src_audio_netbsd_SDL_netbsdaudio.c | 25 +++++++++++++
3 files changed, 29 insertions(+), 3 deletions(-)
diffs (54 lines):
diff -r 7f3e8f65fffa -r 31bf573d76d4 devel/SDL2/Makefile
--- a/devel/SDL2/Makefile Tue Mar 09 16:54:44 2021 +0000
+++ b/devel/SDL2/Makefile Tue Mar 09 20:41:08 2021 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.55 2021/02/07 06:30:17 ryoon Exp $
+# $NetBSD: Makefile,v 1.56 2021/03/09 20:41:08 mrg Exp $
DISTNAME= SDL2-2.0.14
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= devel
MASTER_SITES= https://www.libsdl.org/release/
diff -r 7f3e8f65fffa -r 31bf573d76d4 devel/SDL2/distinfo
--- a/devel/SDL2/distinfo Tue Mar 09 16:54:44 2021 +0000
+++ b/devel/SDL2/distinfo Tue Mar 09 20:41:08 2021 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.44 2021/01/02 15:54:03 nia Exp $
+$NetBSD: distinfo,v 1.45 2021/03/09 20:41:08 mrg Exp $
SHA1 (SDL2-2.0.14.tar.gz) = 212b17d988c417a1a905ab09c50d1845cc48ddb7
RMD160 (SDL2-2.0.14.tar.gz) = 24ddf4bab53fae92fb0c96c7d3e6ceecca91c5df
SHA512 (SDL2-2.0.14.tar.gz) = ebc482585bd565bf3003fbcedd91058b2183e333b9ea566d2f386da0298ff970645d9d25c1aa4459c7c96e9ea839fd1c5f2da0242a56892865b2e456cdd027ee
Size (SDL2-2.0.14.tar.gz) = 6089974 bytes
+SHA1 (patch-src_audio_netbsd_SDL_netbsdaudio.c) = e62b5b57d90b2f79c58b665e6f9f5f45893206f8
diff -r 7f3e8f65fffa -r 31bf573d76d4 devel/SDL2/patches/patch-src_audio_netbsd_SDL_netbsdaudio.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/SDL2/patches/patch-src_audio_netbsd_SDL_netbsdaudio.c Tue Mar 09 20:41:08 2021 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-src_audio_netbsd_SDL_netbsdaudio.c,v 1.1 2021/03/09 20:41:08 mrg Exp $
+
+check the return value of ioctl() on audio device and report error
+if it doesn't work. stops eg mpv from hanging when it thinks that
+it opened the audio device.
+
+--- src/audio/netbsd/SDL_netbsdaudio.c.orig 2020-12-21 11:44:36.000000000 -0600
++++ src/audio/netbsd/SDL_netbsdaudio.c 2021-03-09 14:27:27.994211006 -0600
+@@ -291,9 +291,14 @@
+ 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);
++ if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) < 0) {
++ return SDL_SetError("Couldn't AUDIO_SETINFO %s: %s", devname, strerror(errno));
++ }
++
++ if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) {
++ return SDL_SetError("Couldn't AUDIO_GETINFO %s: %s", devname, strerror(errno));
++ }
+ this->spec.freq = prinfo->sample_rate;
+ this->spec.channels = prinfo->channels;
+
Home |
Main Index |
Thread Index |
Old Index