summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authornat <nat@pkgsrc.org>2015-01-03 11:21:07 +0000
committernat <nat@pkgsrc.org>2015-01-03 11:21:07 +0000
commite31c62a3385a830ebb4ea63e160c8161417d86e6 (patch)
treef5d9a458bb2f5efe51b0f8b4931dd88d6da23419 /emulators
parent6ad537148e68971c2edd2b1d1b83ba2ed0fa7ce7 (diff)
downloadpkgsrc-e31c62a3385a830ebb4ea63e160c8161417d86e6.tar.gz
Fix freeze in audio callback on close.
Bump PKGREVISION. This commit was approved by wiz@.
Diffstat (limited to 'emulators')
-rw-r--r--emulators/gnuboy-sdl/Makefile4
-rw-r--r--emulators/gnuboy-sdl/distinfo4
-rw-r--r--emulators/gnuboy-sdl/patches/patch-aa30
3 files changed, 25 insertions, 13 deletions
diff --git a/emulators/gnuboy-sdl/Makefile b/emulators/gnuboy-sdl/Makefile
index 003caef21a7..e4b505fb549 100644
--- a/emulators/gnuboy-sdl/Makefile
+++ b/emulators/gnuboy-sdl/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.13 2012/12/12 10:44:08 wiz Exp $
+# $NetBSD: Makefile,v 1.14 2015/01/03 11:21:07 nat Exp $
DISTNAME= gnuboy-1.0.3
PKGNAME= ${DISTNAME:S/-/-sdl-/}
-PKGREVISION= 5
+PKGREVISION= 6
CATEGORIES= emulators
MASTER_SITES= http://gnuboy.unix-fu.org/src/
diff --git a/emulators/gnuboy-sdl/distinfo b/emulators/gnuboy-sdl/distinfo
index bbd6a0ec82c..ee78332e0b2 100644
--- a/emulators/gnuboy-sdl/distinfo
+++ b/emulators/gnuboy-sdl/distinfo
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.3 2013/10/28 23:45:28 joerg Exp $
+$NetBSD: distinfo,v 1.4 2015/01/03 11:21:07 nat Exp $
SHA1 (gnuboy-1.0.3.tar.gz) = 4c371445b6599c6636d08ba9c5de7bb9fbf78437
RMD160 (gnuboy-1.0.3.tar.gz) = dfaf927fe2d4e03f39d83079b7dd3aa02c8983b9
Size (gnuboy-1.0.3.tar.gz) = 187627 bytes
-SHA1 (patch-aa) = 266f39882e2aa3cc3350a6080ecc6e8738c92160
+SHA1 (patch-aa) = c72c7de796e01e3a9d123b2bd7464d7397cc6cd5
SHA1 (patch-configure) = 63b9ee2fe6e13f06354a3ef95bb3dedc41221990
diff --git a/emulators/gnuboy-sdl/patches/patch-aa b/emulators/gnuboy-sdl/patches/patch-aa
index dd114909e6b..b863f8ef617 100644
--- a/emulators/gnuboy-sdl/patches/patch-aa
+++ b/emulators/gnuboy-sdl/patches/patch-aa
@@ -1,8 +1,16 @@
-$NetBSD: patch-aa,v 1.1.1.1 2004/07/26 17:05:05 dillo Exp $
+$NetBSD: patch-aa,v 1.2 2015/01/03 11:21:07 nat Exp $
---- sys/sdl/sdl.c.orig 2001-09-17 18:40:14.000000000 +0200
+--- sys/sdl/sdl.c.orig 2001-09-17 16:40:14.000000000 +0000
+++ sys/sdl/sdl.c
-@@ -441,6 +441,8 @@ static int sound = 1;
+@@ -28,6 +28,7 @@ static int use_joy = 1, sdl_joy_num;
+ static SDL_Joystick * sdl_joy = NULL;
+ static const int joy_commit_range = 3276;
+ static char Xstatus, Ystatus;
++static int closing = 0;
+
+ static SDL_Surface *screen;
+ static SDL_Overlay *overlay;
+@@ -441,6 +442,8 @@ static int sound = 1;
static int samplerate = 44100;
static int stereo = 1;
static volatile int audio_done;
@@ -11,25 +19,29 @@ $NetBSD: patch-aa,v 1.1.1.1 2004/07/26 17:05:05 dillo Exp $
rcvar_t pcm_exports[] =
{
-@@ -453,8 +455,16 @@ rcvar_t pcm_exports[] =
+@@ -453,8 +456,19 @@ rcvar_t pcm_exports[] =
static void audio_callback(void *blah, byte *stream, int len)
{
-+ SDL_SemWait(pcm_rsem);
- memcpy(stream, pcm.buf, len);
+- memcpy(stream, pcm.buf, len);
- audio_done = 1;
-+ SDL_SemPost(pcm_wsem);
++ if (!closing) {
++ SDL_SemWait(pcm_rsem);
++ memcpy(stream, pcm.buf, len);
++ SDL_SemPost(pcm_wsem);
++ }
+}
+
+
+static void audio_atexit(void)
+{
++ closing = 1;
+ if (pcm_wsem)
+ SDL_SemPost(pcm_rsem);
}
-@@ -466,6 +476,13 @@ void pcm_init()
+@@ -466,6 +480,13 @@ void pcm_init()
if (!sound) return;
SDL_InitSubSystem(SDL_INIT_AUDIO);
@@ -43,7 +55,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2004/07/26 17:05:05 dillo Exp $
as.freq = samplerate;
as.format = AUDIO_U8;
as.channels = 1 + stereo;
-@@ -491,16 +508,20 @@ int pcm_submit()
+@@ -491,16 +512,20 @@ int pcm_submit()
{
if (!pcm.buf) return 0;
if (pcm.pos < pcm.len) return 1;