From 6142e86b842ece14ab2652ab9f8b6f177fe998e5 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 25 Jun 2010 16:53:27 +0000 Subject: af_ladspa: Fix multiple instances of a filter type 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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31558 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af_ladspa.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libaf/af_ladspa.c b/libaf/af_ladspa.c index bab44191be..ace8302b54 100644 --- a/libaf/af_ladspa.c +++ b/libaf/af_ladspa.c @@ -833,12 +833,11 @@ static af_data_t* play(struct af_instance_s *af, af_data_t *data) { /* 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. -- cgit v1.2.3