From b31aad83230e59bae8a1266b5f2a842689d22bdc Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sun, 16 Aug 2015 00:15:55 -0500 Subject: [PATCH] Fix for bug #1117 Previous fix didn't produce the same results as 2.0.6, this one should. --- src/effects/Effect.cpp | 5 +++++ src/effects/Reverb.cpp | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 4748887e3..f0be05ed6 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -1282,6 +1282,11 @@ bool Effect::Process() CopyInputTracks(Track::All); bool bGoodResult = true; + // It's possible that the number of channels the effect expects changed based on + // the parameters (the Audacity Reverb effect does when the stereo width is 0). + mNumAudioIn = GetAudioInCount(); + mNumAudioOut = GetAudioOutCount(); + mPass = 1; if (InitPass1()) { diff --git a/src/effects/Reverb.cpp b/src/effects/Reverb.cpp index ece77c13b..e026aeca4 100644 --- a/src/effects/Reverb.cpp +++ b/src/effects/Reverb.cpp @@ -151,12 +151,12 @@ EffectType EffectReverb::GetType() int EffectReverb::GetAudioInCount() { - return 2; + return mParams.mStereoWidth ? 2 : 1; } int EffectReverb::GetAudioOutCount() { - return 2; + return mParams.mStereoWidth ? 2 : 1; } #define BLOCK 16384 @@ -230,7 +230,7 @@ sampleCount EffectReverb::ProcessBlock(float **inBlock, float **outBlock, sample reverb_process(&mP[c].reverb, len); } - if (mNumChans == 2 && mParams.mStereoWidth) + if (mNumChans == 2) { for (sampleCount i = 0; i < len; i++) {