head 1.4; access; symbols pkgsrc-2013Q2:1.4.0.34 pkgsrc-2013Q2-base:1.4 pkgsrc-2012Q4:1.4.0.32 pkgsrc-2012Q4-base:1.4 pkgsrc-2011Q4:1.4.0.30 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q2:1.4.0.28 pkgsrc-2011Q2-base:1.4 pkgsrc-2009Q4:1.4.0.26 pkgsrc-2009Q4-base:1.4 pkgsrc-2008Q4:1.4.0.24 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.4.0.22 pkgsrc-2008Q3-base:1.4 cube-native-xorg:1.4.0.20 cube-native-xorg-base:1.4 pkgsrc-2008Q2:1.4.0.18 pkgsrc-2008Q2-base:1.4 pkgsrc-2008Q1:1.4.0.16 pkgsrc-2008Q1-base:1.4 pkgsrc-2007Q4:1.4.0.14 pkgsrc-2007Q4-base:1.4 pkgsrc-2007Q3:1.4.0.12 pkgsrc-2007Q3-base:1.4 pkgsrc-2007Q2:1.4.0.10 pkgsrc-2007Q2-base:1.4 pkgsrc-2007Q1:1.4.0.8 pkgsrc-2007Q1-base:1.4 pkgsrc-2006Q4:1.4.0.6 pkgsrc-2006Q4-base:1.4 pkgsrc-2006Q3:1.4.0.4 pkgsrc-2006Q3-base:1.4 pkgsrc-2006Q2:1.4.0.2 pkgsrc-2006Q2-base:1.4 pkgsrc-2006Q1:1.3.0.10 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.8 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.6 pkgsrc-2005Q3-base:1.3 pkgsrc-2005Q2:1.3.0.4 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.3.0.2 pkgsrc-2005Q1-base:1.3 pkgsrc-2004Q4:1.2.0.10 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.8 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.6 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.2.0.4 pkgsrc-2004Q1-base:1.2 pkgsrc-2003Q4:1.2.0.2 pkgsrc-2003Q4-base:1.2; locks; strict; comment @# @; 1.4 date 2006.06.12.16.20.44; author wiz; state dead; branches; next 1.3; 1.3 date 2005.01.05.12.05.19; author adam; state Exp; branches; next 1.2; 1.2 date 2003.07.26.23.05.34; author jmmv; state Exp; branches; next 1.1; 1.1 date 2003.07.26.21.38.23; author jmmv; state Exp; branches; next ; desc @@ 1.4 log @Update to 1.2.10. Package changes: Merge SDL-arts, SDL-esound, and SDL-nas packages back as options, all defaulting to on (add "-arts -esound -nas" to PKG_OPTIONS.SDL to get the previous behaviour of this package). Reason: trying to get and stay in sync with upstream, who decided not to take back the relevant changes. Ok jmmv@@ Also follow upstream w.r.t. library version numbers; bump BUILDLINK_API_DEPENDS for that (no real reason to diverge here). Most patches have been integrated upstream. Changes in 1.2.10: 1.2.10: If SDL_OpenAudio() is passed zero for the desired format fields, the following environment variables will be used to fill them in: SDL_AUDIO_FREQUENCY SDL_AUDIO_FORMAT SDL_AUDIO_CHANNELS SDL_AUDIO_SAMPLES If an environment variable is not specified, it will be set to a reasonable default value. Added support for the SDL_VIDEO_FULLSCREEN_HEAD environment variable, currently supported on X11 Xinerama configurations. Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications. Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration. Added current_w and current_h to the SDL_VideoInfo structure, which is set to the desktop resolution during video intialization, and then set to the current resolution when a video mode is set. SDL_SetVideoMode() now accepts 0 for width or height and will use the current video mode (or the desktop mode if no mode has been set.) Added SDL_GetKeyRepeat() Added SDL_config.h, with defaults for various build environments. @ text @$NetBSD: patch-ba,v 1.3 2005/01/05 12:05:19 adam Exp $ --- src/audio/SDL_audio.c.orig 2004-12-13 07:54:31.000000000 +0000 +++ src/audio/SDL_audio.c @@@@ -38,8 +38,15 @@@@ static char rcsid = #include "SDL_audiomem.h" #include "SDL_sysaudio.h" +#include "SDL_name.h" +#include "SDL_loadso.h" + /* Available audio drivers */ static AudioBootStrap *bootstrap[] = { + NULL, /* Optional 1: either arts, esd, nas */ + NULL, /* Optional 2: either arts, esd, nas */ + NULL, /* Optional 3: either arts, esd, nas */ +#define PLUGIN_COUNT 3 #ifdef OPENBSD_AUDIO_SUPPORT &OPENBSD_AUDIO_bootstrap, #endif @@@@ -59,15 +66,6 @@@@ static AudioBootStrap *bootstrap[] = { #ifdef DMEDIA_SUPPORT &DMEDIA_bootstrap, #endif -#ifdef ARTSC_SUPPORT - &ARTSC_bootstrap, -#endif -#ifdef ESD_SUPPORT - &ESD_bootstrap, -#endif -#ifdef NAS_SUPPORT - &NAS_bootstrap, -#endif #ifdef ENABLE_DIRECTX &DSOUND_bootstrap, #endif @@@@ -268,16 +266,48 @@@@ static void SDL_UnlockAudio_Default(SDL_ SDL_mutexV(audio->mixer_lock); } +static int SDL_LoadAudioPlugins(void) +{ + int first = PLUGIN_COUNT; + char *envvar; + void *plugin; + +#define DO_LOAD(IDNAME, SONAME, BSNAME, PKGNAME) \ + envvar = getenv("SDL_AUDIO_PLUGIN"); \ + if (envvar == NULL || strcmp(envvar, IDNAME) == 0) { \ + plugin = SDL_LoadObject(SONAME); \ + if (plugin != NULL) { \ + struct AudioBootStrap *bs; \ + bs = SDL_LoadFunction(plugin, BSNAME); \ + if (bs != NULL) { \ + bootstrap[--first] = bs; \ + } \ + } else if (envvar != NULL && strcmp(envvar, IDNAME) == 0) { \ + fprintf(stderr, "SDL (pkgsrc): SDL_AUDIO_PLUGIN is explicitly set to `" IDNAME "'.\n"); \ + fprintf(stderr, "SDL (pkgsrc): Please install the " PKGNAME " package and retry.\n"); \ + } \ + } + + DO_LOAD("arts", "libaudio_arts.so", "ARTSC_bootstrap", "audio/SDL-arts"); + DO_LOAD("esound", "libaudio_esd.so", "ESD_bootstrap", "audio/SDL-esound"); + DO_LOAD("nas", "libaudio_nas.so", "NAS_bootstrap", "audio/SDL-nas"); +#undef DO_LOAD + + return first; +} + int SDL_AudioInit(const char *driver_name) { SDL_AudioDevice *audio; - int i = 0, idx; + int i = 0, idx, first; /* Check to make sure we don't overwrite 'current_audio' */ if ( current_audio != NULL ) { SDL_AudioQuit(); } + first = SDL_LoadAudioPlugins(); + /* Select the proper audio driver */ audio = NULL; idx = 0; @@@@ -287,7 +317,7 @@@@ int SDL_AudioInit(const char *driver_nam to use ESD, but don't start it if it's not already running. This probably isn't the place to do this, but... Shh! :) */ - for ( i=0; bootstrap[i]; ++i ) { + for ( i=first; bootstrap[i]; ++i ) { if ( strcmp(bootstrap[i]->name, "esd") == 0 ) { const char *esd_no_spawn; @@@@ -316,7 +346,7 @@@@ int SDL_AudioInit(const char *driver_nam idx = atoi(strrchr(driver_name, ':')+1); } #endif - for ( i=0; bootstrap[i]; ++i ) { + for ( i=first; bootstrap[i]; ++i ) { if (strncmp(bootstrap[i]->name, driver_name, strlen(bootstrap[i]->name)) == 0) { if ( bootstrap[i]->available() ) { @@@@ -326,7 +356,7 @@@@ int SDL_AudioInit(const char *driver_nam } } } else { - for ( i=0; bootstrap[i]; ++i ) { + for ( i=first; bootstrap[i]; ++i ) { if ( bootstrap[i]->available() ) { audio = bootstrap[i]->create(idx); if ( audio != NULL ) { @ 1.3 log @Changes 1.2.8: * Fixed compiling under newer versions of gcc * Fixed floating point exception with Linux 2.6 joysticks * Added 4/6 channel surround sound support on ALSA (not 3D audio) * Fixed mouse coordinate inversion on MacOS X * Added a CoreAudio sound driver for MacOS X * Added MacOS X Xcode build environment support * Updated QNX support for QNX6 * Improved Atari port, including OSMesa support * Numerous other bug fixes and platform support improvements @ text @d1 1 a1 1 $NetBSD$ @ 1.2 log @Let the NAS audio driver be a plugin too, to get rid of the SDL_USE_NAS build definition. Bump revision again, to 6, for better dependancy handling. @ text @d1 1 a1 1 $NetBSD: patch-ba,v 1.1 2003/07/26 21:38:23 jmmv Exp $ d3 1 a3 1 --- src/audio/SDL_audio.c.orig 2002-10-05 18:50:56.000000000 +0200 d21 1 a21 1 @@@@ -56,15 +63,6 @@@@ static AudioBootStrap *bootstrap[] = { d37 1 a37 1 @@@@ -252,16 +250,48 @@@@ static void SDL_UnlockAudio_Default(SDL_ d87 1 a87 1 @@@@ -271,7 +301,7 @@@@ int SDL_AudioInit(const char *driver_nam d96 1 a96 1 @@@@ -300,7 +330,7 @@@@ int SDL_AudioInit(const char *driver_nam d105 1 a105 1 @@@@ -310,7 +340,7 @@@@ int SDL_AudioInit(const char *driver_nam @ 1.1 log @Implement loadable plugin support for arts and esound output. This is to avoid using build variable definitions, and to allow optional use of these daemons on machines where binary packages are used. esound is no longer needed in this package by default. OSS is kept in the package as it was before, beeing the default output driver. Bump PKGREVISION to 5. The patch has been reviewed by wiz@@, the maintainer. It has also been sent back to SDL authors in the hope that they will implement this functionality. Closes PR pkg/21774 by Marc Recht, which requested the addition of arts as an optional dependancy (not done). @ text @d1 1 a1 1 $NetBSD$ d5 1 a5 1 @@@@ -38,8 +38,14 @@@@ static char rcsid = d14 4 a17 3 + NULL, /* Optional 1: either arts or esd */ + NULL, /* Optional 2: either arts or esd */ +#define PLUGIN_COUNT 2 d21 1 a21 1 @@@@ -56,12 +62,6 @@@@ static AudioBootStrap *bootstrap[] = { d31 5 a35 2 #ifdef NAS_SUPPORT &NAS_bootstrap, d37 1 a37 1 @@@@ -252,16 +252,47 @@@@ static void SDL_UnlockAudio_Default(SDL_ d65 1 d87 1 a87 1 @@@@ -271,7 +302,7 @@@@ int SDL_AudioInit(const char *driver_nam d96 1 a96 1 @@@@ -300,7 +331,7 @@@@ int SDL_AudioInit(const char *driver_nam d105 1 a105 1 @@@@ -310,7 +341,7 @@@@ int SDL_AudioInit(const char *driver_nam @