diff libaf/af_ladspa.c @ 31492:e4d6cf87aa06

ladspa: ensure that activate is called on each filter instance, even if we have e.g. multiple mono filters handling a multichannel file. Fixes one of the bugs reported as bug #1685.
author reimar
date Fri, 25 Jun 2010 16:53:27 +0000
parents 0f1b5b68af32
children 8fa2f43cb760
line wrap: on
line diff
--- a/libaf/af_ladspa.c	Fri Jun 25 13:30:34 2010 +0000
+++ b/libaf/af_ladspa.c	Fri Jun 25 16:53:27 2010 +0000
@@ -834,12 +834,11 @@
 
             /* Activate filter (if it isn't already :) ) */
 
-            if ( (pdes->activate) && (setup->activated == 0) ) {
+            if (pdes->activate && !setup->activated && i % setup->ninputs == 0)
                 pdes->activate(setup->chhandles[i]);
-                setup->activated = 1;
-            }
 
         } /* All channels/filters done! except for... */
+        setup->activated = 1;
 
         /* Stereo effect with one channel left. Use same buffer for left
          * and right. connect it to the second port.