summaryrefslogtreecommitdiff
path: root/audio/fluidsynth/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'audio/fluidsynth/patches/patch-aa')
-rw-r--r--audio/fluidsynth/patches/patch-aa150
1 files changed, 25 insertions, 125 deletions
diff --git a/audio/fluidsynth/patches/patch-aa b/audio/fluidsynth/patches/patch-aa
index 701b8797bee..c9be99e42ae 100644
--- a/audio/fluidsynth/patches/patch-aa
+++ b/audio/fluidsynth/patches/patch-aa
@@ -1,8 +1,8 @@
-$NetBSD: patch-aa,v 1.2 2007/12/16 15:18:29 adam Exp $
+$NetBSD: patch-aa,v 1.3 2012/01/28 13:15:32 wiz Exp $
---- src/fluid_oss.c.orig 2007-09-19 08:10:57.000000000 +0200
-+++ src/fluid_oss.c
-@@ -43,6 +43,12 @@
+--- src/drivers/fluid_oss.c.orig 2011-09-04 07:38:58.000000000 +0000
++++ src/drivers/fluid_oss.c
+@@ -42,6 +42,12 @@
#include <errno.h>
#include <sys/poll.h>
@@ -14,8 +14,8 @@ $NetBSD: patch-aa,v 1.2 2007/12/16 15:18:29 adam Exp $
+
#define BUFFER_LENGTH 512
- /* SCHED_FIFO priorities for OSS threads (see pthread_attr_setschedparam) */
-@@ -103,7 +109,7 @@ static void* fluid_oss_midi_run(void* d)
+ // Build issue on some systems (OSS 4.0)?
+@@ -101,7 +107,7 @@ static void fluid_oss_midi_run(void* d);
void
fluid_oss_audio_driver_settings(fluid_settings_t* settings)
{
@@ -24,91 +24,25 @@ $NetBSD: patch-aa,v 1.2 2007/12/16 15:18:29 adam Exp $
}
/*
-@@ -122,8 +128,10 @@ new_fluid_oss_audio_driver(fluid_setting
- int format;
- pthread_attr_t attr;
- int err;
-+#if !defined(__NetBSD__)
- int sched = SCHED_FIFO;
- struct sched_param priority;
-+#endif
-
- dev = FLUID_NEW(fluid_oss_audio_driver_t);
- if (dev == NULL) {
-@@ -168,7 +176,7 @@ new_fluid_oss_audio_driver(fluid_setting
- }
-
- if (!fluid_settings_getstr(settings, "audio.oss.device", &devname)) {
-- devname = "/dev/dsp";
-+ devname = DEVOSSAUDIO;
- }
-
- if (stat(devname, &devstat) == -1) {
-@@ -229,6 +237,13 @@ new_fluid_oss_audio_driver(fluid_setting
- goto error_recovery;
- }
-
-+#ifdef __NetBSD__
-+ err = pthread_create(&dev->thread, &attr, fluid_oss_audio_run, (void*) dev);
-+ if (err) {
-+ FLUID_LOG(FLUID_ERR, "Couldn't create audio thread");
-+ goto error_recovery;
-+ }
-+#else
- /* the pthread_create man page explains that
- pthread_attr_setschedpolicy returns an error if the user is not
- permitted the set SCHED_FIFO. it seems however that no error is
-@@ -264,6 +279,7 @@ new_fluid_oss_audio_driver(fluid_setting
- }
- break;
+@@ -164,7 +170,7 @@ new_fluid_oss_audio_driver(fluid_setting
}
-+#endif /* __NetBSD__ */
- return (fluid_audio_driver_t*) dev;
+ if (!fluid_settings_dupstr(settings, "audio.oss.device", &devname) || !devname) { /* ++ alloc device name */
+- devname = FLUID_STRDUP ("/dev/dsp");
++ devname = FLUID_STRDUP (DEVOSSAUDIO);
-@@ -285,8 +301,10 @@ new_fluid_oss_audio_driver2(fluid_settin
- int format;
- pthread_attr_t attr;
- int err;
-+#if !defined(__NetBSD__)
- int sched = SCHED_FIFO;
- struct sched_param priority;
-+#endif
+ if (devname == NULL) {
+ FLUID_LOG(FLUID_ERR, "Out of memory");
+@@ -278,7 +284,7 @@ new_fluid_oss_audio_driver2(fluid_settin
- dev = FLUID_NEW(fluid_oss_audio_driver_t);
- if (dev == NULL) {
-@@ -311,7 +329,7 @@ new_fluid_oss_audio_driver2(fluid_settin
+ if (!fluid_settings_dupstr(settings, "audio.oss.device", &devname) || !devname) {
+- devname = FLUID_STRDUP ("/dev/dsp");
++ devname = FLUID_STRDUP (DEVOSSAUDIO);
- if (!fluid_settings_getstr(settings, "audio.oss.device", &devname)) {
-- devname = "/dev/dsp";
-+ devname = DEVOSSAUDIO;
- }
- if (stat(devname, &devstat) == -1) {
- FLUID_LOG(FLUID_ERR, "Device <%s> does not exists", devname);
-@@ -380,6 +398,13 @@ new_fluid_oss_audio_driver2(fluid_settin
- goto error_recovery;
- }
-
-+#ifdef __NetBSD__
-+ err = pthread_create(&dev->thread, &attr, fluid_oss_audio_run2, (void*) dev);
-+ if (err) {
-+ FLUID_LOG(FLUID_ERR, "Couldn't create audio2 thread");
-+ goto error_recovery;
-+ }
-+#else
- /* the pthread_create man page explains that
- pthread_attr_setschedpolicy returns an error if the user is not
- permitted the set SCHED_FIFO. it seems however that no error is
-@@ -415,6 +440,7 @@ new_fluid_oss_audio_driver2(fluid_settin
- }
- break;
- }
-+#endif /* __NetBSD__ */
-
- return (fluid_audio_driver_t*) dev;
-
-@@ -642,7 +668,7 @@ fluid_oss_audio_run2(void* d)
+ if (!devname)
+ {
+@@ -503,7 +509,7 @@ fluid_oss_audio_run2(void* d)
void fluid_oss_midi_driver_settings(fluid_settings_t* settings)
{
@@ -117,46 +51,12 @@ $NetBSD: patch-aa,v 1.2 2007/12/16 15:18:29 adam Exp $
}
/*
-@@ -655,8 +681,10 @@ new_fluid_oss_midi_driver(fluid_settings
- int err;
- fluid_oss_midi_driver_t* dev;
- pthread_attr_t attr;
-+#if !defined __NetBSD__
- int sched = SCHED_FIFO;
- struct sched_param priority;
-+#endif
- char* device;
+@@ -546,7 +552,7 @@ new_fluid_oss_midi_driver(fluid_settings
+ fluid_settings_dupstr(settings, "midi.oss.device", &device); /* ++ alloc device name */
- /* not much use doing anything */
-@@ -687,7 +715,7 @@ new_fluid_oss_midi_driver(fluid_settings
- /* get the device name. if none is specified, use the default device. */
- fluid_settings_getstr(settings, "midi.oss.device", &device);
if (device == NULL) {
-- device = "/dev/midi";
-+ device = DEVOSSMIDI;
- }
-
- /* open the default hardware device. only use midi in. */
-@@ -704,6 +732,14 @@ new_fluid_oss_midi_driver(fluid_settings
- FLUID_LOG(FLUID_ERR, "Couldn't initialize midi thread attributes");
- goto error_recovery;
- }
-+
-+#ifdef __NetBSD__
-+ err = pthread_create(&dev->thread, &attr, fluid_oss_midi_run, (void*) dev);
-+ if (err) {
-+ FLUID_LOG(FLUID_ERR, "Couldn't create midi thread");
-+ goto error_recovery;
-+ }
-+#else
- /* use fifo scheduling. if it fails, use default scheduling. */
- while (1) {
- err = pthread_attr_setschedpolicy(&attr, sched);
-@@ -735,6 +771,7 @@ new_fluid_oss_midi_driver(fluid_settings
- }
- break;
- }
-+#endif /* __NetBSD__ */
- return (fluid_midi_driver_t*) dev;
+- device = FLUID_STRDUP ("/dev/midi");
++ device = FLUID_STRDUP (DEVOSSMIDI);
- error_recovery:
+ if (!device)
+ {