[email protected]

Here's a slightly revised diff (some style changes and more comments).

It seems XMMS completely broke the Effect plugin system after they added
support for multiple enabled effects.  The only way to fix this seems to
be to patch up XMMS but as far as I can tell, none of the plugins we have
are affected by this.

If you want effects to work, please test this so it can be committed.

Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/xmms/Makefile,v
retrieving revision 1.70
diff -u -p -r1.70 Makefile
--- Makefile    18 Oct 2010 16:52:48 -0000      1.70
+++ Makefile    23 Oct 2010 11:34:12 -0000
@@ -10,7 +10,7 @@ SHARED_ONLY=          Yes
 VERSION=               1.2.11
 DISTNAME=              xmms-${VERSION}
 PKGNAME-main=          xmms-${VERSION}
-REVISION-main=         7
+REVISION-main=         8
 PKGNAME-vorbis=                xmms-vorbis-${VERSION}
 REVISION-vorbis=       1
 PKGNAME-mikmod=                xmms-mikmod-${VERSION}
Index: files/audio_sndio.c
===================================================================
RCS file: /cvs/ports/audio/xmms/files/audio_sndio.c,v
retrieving revision 1.2
diff -u -p -r1.2 audio_sndio.c
--- files/audio_sndio.c 16 Jan 2009 04:15:46 -0000      1.2
+++ files/audio_sndio.c 23 Oct 2010 11:34:12 -0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008,2009 Thomas Pfaff <[email protected]>
+ * Copyright (c) 2008-2010 Thomas Pfaff <[email protected]>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -26,7 +26,7 @@
 #include <xmms/i18n.h>
 #include <xmms/plugin.h>
 
-#define VERSION "1.0"
+#define VERSION "1.1"
 #define XMMS_MAXVOL 100
 
 static void op_init (void);
@@ -57,6 +57,7 @@ static long long wrpos;
 static int paused;
 static int volume = XMMS_MAXVOL;
 static long bytes_per_sec;
+static AFormat afmt;
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 
 static GtkWidget *configure_win;
@@ -153,6 +154,7 @@ op_open (AFormat fmt, int rate, int nch)
        }
 
        sio_initpar (&par);
+       afmt = fmt;
        switch (fmt) {
        case FMT_U8:
                par.bits = 8;
@@ -245,14 +247,25 @@ error:
 static void
 op_write (void *ptr, int len)
 {
-       if (!paused) {
-               /* Do not lock sio_write as this will cause the GUI thread
-                  to block waiting for a blocked sio_write to return. */
-               int bytes = sio_write (hdl, ptr, len);
-               pthread_mutex_lock (&mutex);
-               wrpos += bytes;
-               pthread_mutex_unlock (&mutex);
-       }
+       EffectPlugin *ep;
+
+       if (paused)
+               return;
+
+       /* This sucks but XMMS totally broke the effect plugin code when
+          they added support for multiple enabled effects.  Complain to
+          the non-existent XMMS team if a plugin does not work, however
+          this does not seem to affect any plugins in our ports tree. */
+       ep = get_current_effect_plugin ();
+       ep->mod_samples (&ptr, len, afmt, par.rate, par.pchan);
+
+       /* Do not lock sio_write as this will cause the GUI thread
+          to block waiting for a blocked sio_write to return. */
+       len = sio_write (hdl, ptr, len);
+
+       pthread_mutex_lock (&mutex);
+       wrpos += len;
+       pthread_mutex_unlock (&mutex);
 }
 
 static void

Reply via email to