changeset 2811:1c7ee5ed3a10 trunk

[svn] Move effect plugin handling into the main thread
author ertzing
date Sun, 27 May 2007 14:31:34 -0700
parents 49bcc7349295
children 5bd949bbd1c7
files ChangeLog src/audacious/build_stamp.c src/audacious/output.c
diffstat 3 files changed, 44 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat May 26 09:18:11 2007 -0700
+++ b/ChangeLog	Sun May 27 14:31:34 2007 -0700
@@ -1,3 +1,12 @@
+2007-05-26 16:18:11 +0000  Michael Farber <01mf02@gmail.com>
+  revision [4646]
+  - Fixed some very visible errors in German translation
+  
+  
+  trunk/po/de.po |    4 ++--
+  1 file changed, 2 insertions(+), 2 deletions(-)
+
+
 2007-05-26 12:47:35 +0000  Michael Farber <01mf02@gmail.com>
   revision [4644]
   - Made stuff prettier
--- a/src/audacious/build_stamp.c	Sat May 26 09:18:11 2007 -0700
+++ b/src/audacious/build_stamp.c	Sun May 27 14:31:34 2007 -0700
@@ -1,2 +1,2 @@
 #include <glib.h>
-const gchar *svn_stamp = "20070526-4644";
+const gchar *svn_stamp = "20070526-4646";
--- a/src/audacious/output.c	Sat May 26 09:18:11 2007 -0700
+++ b/src/audacious/output.c	Sun May 27 14:31:34 2007 -0700
@@ -34,6 +34,8 @@
 #include "playlist.h"
 #include "configdb.h"
 
+#include "effect.h"
+
 #include <math.h>
 
 #ifdef USE_SRC
@@ -425,7 +427,11 @@
     guint myorder = G_BYTE_ORDER == G_LITTLE_ENDIAN ? FMT_S16_LE : FMT_S16_BE;
     int caneq = (fmt == FMT_S16_NE || fmt == myorder);
     OutputPlugin *op = get_current_output_plugin();
+    EffectPlugin *ep = get_current_effect_plugin();
     int writeoffs;
+    AFormat new_format;
+    gint new_rate;
+    gint new_nch;
 
 #ifdef USE_SRC
     if(src_state != NULL&&length > 0)
@@ -488,6 +494,34 @@
     /* do vis plugin(s) */
     input_add_vis_pcm(time, fmt, nch, length, ptr);
 
+    /* do effect plugin(s) */
+    if (effects_enabled() && ep && ep->query_format) {
+        new_format = op_state.fmt;
+        new_rate = op_state.rate;
+        new_nch = op_state.nch;
+
+        ep->query_format(&new_format, &new_rate, &new_nch);
+
+        if (new_format != op_state.fmt ||
+            new_rate != op_state.rate ||
+            new_nch != op_state.nch) {
+            /*
+             * The effect plugin changes the stream format. Reopen the
+             * audio device.
+             */
+            if (0 == output_open_audio(new_format, new_rate, new_nch)) {
+                /*
+                 * Fatal error.
+                 */
+                return;
+            }
+        }
+    }
+
+    if (effects_enabled() && ep && ep->mod_samples)
+        length = ep->mod_samples(&ptr, length, op_state.fmt,
+                op_state.rate, op_state.nch);
+
     writeoffs = 0;
     while (writeoffs < length)
     {