Unreviewed, rolling out r108263.
authoryutak@chromium.org <yutak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 00:57:20 +0000 (00:57 +0000)
committeryutak@chromium.org <yutak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 00:57:20 +0000 (00:57 +0000)
http://trac.webkit.org/changeset/108263
https://bugs.webkit.org/show_bug.cgi?id=77856

Broke Chromium Windows build.

* platform/audio/DynamicsCompressor.cpp:
(WebCore::DynamicsCompressor::DynamicsCompressor):
(WebCore::DynamicsCompressor::setEmphasisStageParameters):
(WebCore::DynamicsCompressor::process):
(WebCore::DynamicsCompressor::reset):
* platform/audio/DynamicsCompressor.h:
(WebCore::DynamicsCompressor::isStereo):
(DynamicsCompressor):
* platform/audio/DynamicsCompressorKernel.cpp:
(WebCore::DynamicsCompressorKernel::DynamicsCompressorKernel):
(WebCore::DynamicsCompressorKernel::setPreDelayTime):
(WebCore::DynamicsCompressorKernel::process):
(WebCore::DynamicsCompressorKernel::reset):
* platform/audio/DynamicsCompressorKernel.h:
(DynamicsCompressorKernel):
* webaudio/DynamicsCompressorNode.cpp:
(WebCore::DynamicsCompressorNode::DynamicsCompressorNode):
(WebCore::DynamicsCompressorNode::initialize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108271 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/audio/DynamicsCompressor.cpp
Source/WebCore/platform/audio/DynamicsCompressor.h
Source/WebCore/platform/audio/DynamicsCompressorKernel.cpp
Source/WebCore/platform/audio/DynamicsCompressorKernel.h
Source/WebCore/webaudio/DynamicsCompressorNode.cpp

index d5c2b00..1186f15 100644 (file)
@@ -1,3 +1,30 @@
+2012-02-20  Yuta Kitamura  <yutak@chromium.org>
+
+        Unreviewed, rolling out r108263.
+        http://trac.webkit.org/changeset/108263
+        https://bugs.webkit.org/show_bug.cgi?id=77856
+
+        Broke Chromium Windows build.
+
+        * platform/audio/DynamicsCompressor.cpp:
+        (WebCore::DynamicsCompressor::DynamicsCompressor):
+        (WebCore::DynamicsCompressor::setEmphasisStageParameters):
+        (WebCore::DynamicsCompressor::process):
+        (WebCore::DynamicsCompressor::reset):
+        * platform/audio/DynamicsCompressor.h:
+        (WebCore::DynamicsCompressor::isStereo):
+        (DynamicsCompressor):
+        * platform/audio/DynamicsCompressorKernel.cpp:
+        (WebCore::DynamicsCompressorKernel::DynamicsCompressorKernel):
+        (WebCore::DynamicsCompressorKernel::setPreDelayTime):
+        (WebCore::DynamicsCompressorKernel::process):
+        (WebCore::DynamicsCompressorKernel::reset):
+        * platform/audio/DynamicsCompressorKernel.h:
+        (DynamicsCompressorKernel):
+        * webaudio/DynamicsCompressorNode.cpp:
+        (WebCore::DynamicsCompressorNode::DynamicsCompressorNode):
+        (WebCore::DynamicsCompressorNode::initialize):
+
 2012-02-20  Raymond Liu  <raymond.liu@intel.com>
 
         Have the DynamicsCompressorNode support multi-channel data
index 1794b78..a552057 100644 (file)
@@ -40,20 +40,16 @@ namespace WebCore {
 
 using namespace AudioUtilities;
     
-DynamicsCompressor::DynamicsCompressor(float sampleRate, unsigned numberOfChannels)
-    : m_numberOfChannels(numberOfChannels)
-    , m_compressor(sampleRate, numberOfChannels)
+DynamicsCompressor::DynamicsCompressor(bool isStereo, float sampleRate)
+    : m_isStereo(isStereo)
+    , m_sampleRate(sampleRate)
+    , m_compressor(sampleRate)
 {
     // Uninitialized state - for parameter recalculation.
     m_lastFilterStageRatio = -1;
     m_lastAnchor = -1;
     m_lastFilterStageGain = -1;
 
-    for (unsigned i = 0; i < numberOfChannels; ++i) {
-        m_preFilterPacks.append(adoptPtr(new ZeroPoleFilterPack4()));
-        m_postFilterPacks.append(adoptPtr(new ZeroPoleFilterPack4()));
-    }
-
     initializeParameters();
 }
 
@@ -97,20 +93,18 @@ void DynamicsCompressor::setEmphasisStageParameters(unsigned stageIndex, float g
     float r1 = expf(-f1 * piFloat);
     float r2 = expf(-f2 * piFloat);
 
-    ASSERT(m_numberOfChannels == m_preFilterPacks.size());
-
-    for (unsigned i = 0; i < m_numberOfChannels; ++i) {
-        // Set pre-filter zero and pole to create an emphasis filter.
-        ZeroPole& preFilter = m_preFilterPacks[i]->filters[stageIndex];
-        preFilter.setZero(r1);
-        preFilter.setPole(r2);
-
-        // Set post-filter with zero and pole reversed to create the de-emphasis filter.
-        // If there were no compressor kernel in between, they would cancel each other out (allpass filter).
-        ZeroPole& postFilter = m_postFilterPacks[i]->filters[stageIndex];
-        postFilter.setZero(r2);
-        postFilter.setPole(r1);
-    }
+    // Set pre-filter zero and pole to create an emphasis filter.
+    m_preFilter[stageIndex].setZero(r1);
+    m_preFilter[stageIndex].setPole(r2);
+    m_preFilterR[stageIndex].setZero(r1);
+    m_preFilterR[stageIndex].setPole(r2);
+
+    // Set post-filter with zero and pole reversed to create the de-emphasis filter.
+    // If there were no compressor kernel in between, they would cancel each other out (allpass filter).
+    m_postFilter[stageIndex].setZero(r2);
+    m_postFilter[stageIndex].setPole(r1);
+    m_postFilterR[stageIndex].setZero(r2);
+    m_postFilterR[stageIndex].setPole(r1);
 }
 
 void DynamicsCompressor::setEmphasisParameters(float gain, float anchorFreq, float filterStageRatio)
@@ -123,43 +117,18 @@ void DynamicsCompressor::setEmphasisParameters(float gain, float anchorFreq, flo
 
 void DynamicsCompressor::process(const AudioBus* sourceBus, AudioBus* destinationBus, unsigned framesToProcess)
 {
-    // Though numberOfChannels is retrived from destinationBus, we still name it numberOfChannels instead of numberOfDestinationChannels.
-    // It's because we internally match sourceChannels's size to destinationBus by channel up/down mix. Thus we need numberOfChannels
-    // to do the loop work for both sourceChannels and destinationChannels.
-
-    unsigned numberOfChannels = destinationBus->numberOfChannels();
-    unsigned numberOfSourceChannels = sourceBus->numberOfChannels();
-
-    ASSERT(numberOfSourceChannels);
+    const float* sourceL = sourceBus->channel(0)->data();
+    const float* sourceR;
 
-    if (!numberOfSourceChannels) {
-        destinationBus->zero();
-        return;
-    }
+    if (sourceBus->numberOfChannels() > 1)
+        sourceR = sourceBus->channel(1)->data();
+    else
+        sourceR = sourceL;
 
-    const float* sourceChannels[numberOfChannels];
-    float* destinationChannels[numberOfChannels];
-
-    switch (numberOfChannels) {
-    case 2: // stereo
-        sourceChannels[0] = sourceBus->channel(0)->data();
-
-        if (numberOfSourceChannels > 1)
-            sourceChannels[1] = sourceBus->channel(1)->data();
-        else
-            // Simply duplicate mono channel input data to right channel for stereo processing.
-            sourceChannels[1] = sourceChannels[0];
-
-        break;
-    default:
-        // FIXME : support other number of channels.
-        ASSERT_NOT_REACHED();
-        destinationBus->zero();
-        return;
-    }
+    ASSERT(destinationBus->numberOfChannels() == 2);
 
-    for (unsigned i = 0; i < numberOfChannels; ++i)
-        destinationChannels[i] = destinationBus->channel(i)->mutableData();
+    float* destinationL = destinationBus->channel(0)->mutableData();
+    float* destinationR = destinationBus->channel(1)->mutableData();
 
     float filterStageGain = parameterValue(ParamFilterStageGain);
     float filterStageRatio = parameterValue(ParamFilterStageRatio);
@@ -175,15 +144,16 @@ void DynamicsCompressor::process(const AudioBus* sourceBus, AudioBus* destinatio
 
     // Apply pre-emphasis filter.
     // Note that the final three stages are computed in-place in the destination buffer.
-    for (unsigned i = 0; i < numberOfChannels; ++i) {
-        const float* sourceData = sourceChannels[i];
-        float* destinationData = destinationChannels[i];
-        ZeroPole* preFilters = m_preFilterPacks[i]->filters;
-
-        preFilters[0].process(sourceData, destinationData, framesToProcess);
-        preFilters[1].process(destinationData, destinationData, framesToProcess);
-        preFilters[2].process(destinationData, destinationData, framesToProcess);
-        preFilters[3].process(destinationData, destinationData, framesToProcess);
+    m_preFilter[0].process(sourceL, destinationL, framesToProcess);
+    m_preFilter[1].process(destinationL, destinationL, framesToProcess);
+    m_preFilter[2].process(destinationL, destinationL, framesToProcess);
+    m_preFilter[3].process(destinationL, destinationL, framesToProcess);
+
+    if (isStereo()) {
+        m_preFilterR[0].process(sourceR, destinationR, framesToProcess);
+        m_preFilterR[1].process(destinationR, destinationR, framesToProcess);
+        m_preFilterR[2].process(destinationR, destinationR, framesToProcess);
+        m_preFilterR[3].process(destinationR, destinationR, framesToProcess);
     }
 
     float dbThreshold = parameterValue(ParamThreshold);
@@ -207,9 +177,10 @@ void DynamicsCompressor::process(const AudioBus* sourceBus, AudioBus* destinatio
 
     // Apply compression to the pre-filtered signal.
     // The processing is performed in place.
-    m_compressor.process(destinationChannels,
-                         destinationChannels,
-                         numberOfChannels,
+    m_compressor.process(destinationL,
+                         destinationL,
+                         destinationR,
+                         destinationR,
                          framesToProcess,
 
                          dbThreshold,
@@ -227,14 +198,16 @@ void DynamicsCompressor::process(const AudioBus* sourceBus, AudioBus* destinatio
                          );
 
     // Apply de-emphasis filter.
-    for (unsigned i = 0; i < numberOfChannels; ++i) {
-        float* destinationData = destinationChannels[i];
-        ZeroPole* postFilters = m_postFilterPacks[i]->filters;
-
-        postFilters[0].process(destinationData, destinationData, framesToProcess);
-        postFilters[1].process(destinationData, destinationData, framesToProcess);
-        postFilters[2].process(destinationData, destinationData, framesToProcess);
-        postFilters[3].process(destinationData, destinationData, framesToProcess);
+    m_postFilter[0].process(destinationL, destinationL, framesToProcess);
+    m_postFilter[1].process(destinationL, destinationL, framesToProcess);
+    m_postFilter[2].process(destinationL, destinationL, framesToProcess);
+    m_postFilter[3].process(destinationL, destinationL, framesToProcess);
+
+    if (isStereo()) {
+        m_postFilterR[0].process(destinationR, destinationR, framesToProcess);
+        m_postFilterR[1].process(destinationR, destinationR, framesToProcess);
+        m_postFilterR[2].process(destinationR, destinationR, framesToProcess);
+        m_postFilterR[3].process(destinationR, destinationR, framesToProcess);
     }
 }
 
@@ -244,32 +217,16 @@ void DynamicsCompressor::reset()
     m_lastAnchor = -1;
     m_lastFilterStageGain = -1;
 
-    for (unsigned channel = 0; channel < m_numberOfChannels; ++channel) {
-        for (unsigned stageIndex = 0; stageIndex < 4; ++stageIndex) {
-            m_preFilterPacks[channel]->filters[stageIndex].reset();
-            m_postFilterPacks[channel]->filters[stageIndex].reset();
-        }
+    for (unsigned i = 0; i < 4; ++i) {
+        m_preFilter[i].reset();
+        m_preFilterR[i].reset();
+        m_postFilter[i].reset();
+        m_postFilterR[i].reset();
     }
 
     m_compressor.reset();
 }
 
-void DynamicsCompressor::setNumberOfChannels(unsigned numberOfChannels)
-{
-    if (m_preFilterPacks.size() == numberOfChannels)
-        return;
-
-    m_preFilterPacks.clear();
-    m_postFilterPacks.clear();
-    for (unsigned i = 0; i < numberOfChannels; ++i) {
-        m_preFilterPacks.append(adoptPtr(new ZeroPoleFilterPack4()));
-        m_postFilterPacks.append(adoptPtr(new ZeroPoleFilterPack4()));
-    }
-
-    m_compressor.setNumberOfChannels(numberOfChannels);
-    m_numberOfChannels = numberOfChannels;
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(WEB_AUDIO)
index 7e1bb9d..e0115ee 100644 (file)
@@ -62,26 +62,25 @@ public:
         ParamLast
     };
 
-    DynamicsCompressor(float sampleRate, unsigned numberOfChannels);
+    DynamicsCompressor(bool isStereo, float sampleRate);
 
     void process(const AudioBus* sourceBus, AudioBus* destinationBus, unsigned framesToProcess);
     void reset();
-    void setNumberOfChannels(unsigned);
 
     float parameterValue(unsigned parameterID);
 
+    bool isStereo() const { return m_isStereo; }
     float sampleRate() const { return m_sampleRate; }
     float nyquist() const { return m_sampleRate / 2; }
 
 protected:
-    unsigned m_numberOfChannels;
-
     // m_parameters holds the tweakable compressor parameters.
     // FIXME: expose some of the most important ones (such as threshold, attack, release)
     // as DynamicsCompressorNode attributes.
     float m_parameters[ParamLast];
     void initializeParameters();
 
+    bool m_isStereo;
     float m_sampleRate;
 
     // Emphasis filter controls.
@@ -89,13 +88,11 @@ protected:
     float m_lastAnchor;
     float m_lastFilterStageGain;
 
-    typedef struct {
-        ZeroPole filters[4];
-    } ZeroPoleFilterPack4;
-
-    // Per-channel emphasis filters.
-    Vector<OwnPtr<ZeroPoleFilterPack4> > m_preFilterPacks;
-    Vector<OwnPtr<ZeroPoleFilterPack4> > m_postFilterPacks;
+    // Emphasis filters.
+    ZeroPole m_preFilter[4];
+    ZeroPole m_preFilterR[4];
+    ZeroPole m_postFilter[4];
+    ZeroPole m_postFilterR[4];
 
     void setEmphasisStageParameters(unsigned stageIndex, float gain, float normalizedFrequency /* 0 -> 1 */);
     void setEmphasisParameters(float gain, float anchorFreq, float filterStageRatio);
index 3e943d1..a322a33 100644 (file)
@@ -52,30 +52,20 @@ static float saturate(float x, float k)
     return 1 - exp(-k * x);
 }
 
-DynamicsCompressorKernel::DynamicsCompressorKernel(float sampleRate, unsigned numberOfChannels)
+DynamicsCompressorKernel::DynamicsCompressorKernel(float sampleRate)
     : m_sampleRate(sampleRate)
     , m_lastPreDelayFrames(DefaultPreDelayFrames)
+    , m_preDelayBufferL(MaxPreDelayFrames)
+    , m_preDelayBufferR(MaxPreDelayFrames)
     , m_preDelayReadIndex(0)
     , m_preDelayWriteIndex(DefaultPreDelayFrames)
 {
-    setNumberOfChannels(numberOfChannels);
-
     // Initializes most member variables
     reset();
     
     m_meteringReleaseK = discreteTimeConstantForSampleRate(meteringReleaseTimeConstant, sampleRate);
 }
 
-void DynamicsCompressorKernel::setNumberOfChannels(unsigned numberOfChannels)
-{
-    if (m_preDelayBuffers.size() == numberOfChannels)
-        return;
-
-    m_preDelayBuffers.clear();
-    for (unsigned i = 0; i < numberOfChannels; ++i)
-        m_preDelayBuffers.append(adoptPtr(new AudioFloatArray(MaxPreDelayFrames)));
-}
-
 void DynamicsCompressorKernel::setPreDelayTime(float preDelayTime)
 {
     // Re-configure look-ahead section pre-delay if delay time has changed.
@@ -85,17 +75,17 @@ void DynamicsCompressorKernel::setPreDelayTime(float preDelayTime)
         
     if (m_lastPreDelayFrames != preDelayFrames) {
         m_lastPreDelayFrames = preDelayFrames;
-        for (unsigned i = 0; i < m_preDelayBuffers.size(); ++i)
-            m_preDelayBuffers[i]->zero();
-
+        m_preDelayBufferL.zero();
+        m_preDelayBufferR.zero();
         m_preDelayReadIndex = 0;
         m_preDelayWriteIndex = preDelayFrames;
     }
 }
 
-void DynamicsCompressorKernel::process(float* sourceChannels[],
-                                       float* destinationChannels[],
-                                       unsigned numberOfChannels,
+void DynamicsCompressorKernel::process(const float* sourceL,
+                                       float* destinationL,
+                                       const float* sourceR, /* stereo-linked */
+                                       float* destinationR,
                                        unsigned framesToProcess,
 
                                        float dbThreshold,
@@ -112,8 +102,7 @@ void DynamicsCompressorKernel::process(float* sourceChannels[],
                                        float releaseZone4
                                        )
 {
-    ASSERT(m_preDelayBuffers.size() == numberOfChannels);
-
+    bool isStereo = destinationR;
     float sampleRate = this->sampleRate();
 
     float dryMix = 1 - effectBlend;
@@ -175,7 +164,6 @@ void DynamicsCompressorKernel::process(float* sourceChannels[],
 
     const int nDivisions = framesToProcess / nDivisionFrames;
 
-    unsigned frameIndex = 0;
     for (int i = 0; i < nDivisions; ++i) {
         // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         // Calculate desired gain
@@ -259,6 +247,8 @@ void DynamicsCompressorKernel::process(float* sourceChannels[],
         // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
         {
+            float* delayBufferL = m_preDelayBufferL.data();
+            float* delayBufferR = m_preDelayBufferR.data();
             int preDelayReadIndex = m_preDelayReadIndex;
             int preDelayWriteIndex = m_preDelayWriteIndex;
             float detectorAverage = m_detectorAverage;
@@ -266,19 +256,32 @@ void DynamicsCompressorKernel::process(float* sourceChannels[],
 
             int loopFrames = nDivisionFrames;
             while (loopFrames--) {
-                float compressorInput = 0;
+                float compressorInput;
+                float inputL;
+                float inputR = 0;
 
                 // Predelay signal, computing compression amount from un-delayed version.
-                for (unsigned i = 0; i < numberOfChannels; ++i) {
-                    float* delayBuffer = m_preDelayBuffers[i]->data();
-                    float undelayedSource = sourceChannels[i][frameIndex];
-                    delayBuffer[preDelayWriteIndex] = undelayedSource;
-
-                    float absUndelayedSource = undelayedSource > 0 ? undelayedSource : -undelayedSource;
-                    if (compressorInput < absUndelayedSource)
-                        compressorInput = absUndelayedSource;
+                if (isStereo) {
+                    float undelayedL = *sourceL++;
+                    float undelayedR = *sourceR++;
+
+                    compressorInput = 0.5f * (undelayedL + undelayedR);
+
+                    inputL = delayBufferL[preDelayReadIndex];
+                    inputR = delayBufferR[preDelayReadIndex];
+
+                    delayBufferL[preDelayWriteIndex] = undelayedL;
+                    delayBufferR[preDelayWriteIndex] = undelayedR;
+                } else {
+                    compressorInput = *sourceL++;
+
+                    inputL = delayBufferL[preDelayReadIndex];
+                    delayBufferL[preDelayWriteIndex] = compressorInput;
                 }
 
+                preDelayReadIndex = (preDelayReadIndex + 1) & MaxPreDelayFramesMask;
+                preDelayWriteIndex = (preDelayWriteIndex + 1) & MaxPreDelayFramesMask;
+
                 // Calculate shaped power on undelayed input.
 
                 float scaledInput = compressorInput;
@@ -334,14 +337,17 @@ void DynamicsCompressorKernel::process(float* sourceChannels[],
                     m_meteringGain += (dbRealGain - m_meteringGain) * m_meteringReleaseK;
 
                 // Apply final gain.
-                for (unsigned i = 0; i < numberOfChannels; ++i) {
-                    float* delayBuffer = m_preDelayBuffers[i]->data();
-                    destinationChannels[i][frameIndex] = delayBuffer[preDelayReadIndex] * totalGain;
-                }
+                if (isStereo) {
+                    float outputL = inputL;
+                    float outputR = inputR;
 
-                frameIndex++;
-                preDelayReadIndex = (preDelayReadIndex + 1) & MaxPreDelayFramesMask;
-                preDelayWriteIndex = (preDelayWriteIndex + 1) & MaxPreDelayFramesMask;
+                    outputL *= totalGain;
+                    outputR *= totalGain;
+
+                    *destinationL++ = outputL;
+                    *destinationR++ = outputR;
+                } else
+                    *destinationL++ = inputL * totalGain;
             }
 
             // Locals back to member variables.
@@ -360,9 +366,8 @@ void DynamicsCompressorKernel::reset()
     m_meteringGain = 1;
 
     // Predelay section.
-    for (unsigned i = 0; i < m_preDelayBuffers.size(); ++i)
-        m_preDelayBuffers[i]->zero();
-
+    m_preDelayBufferL.zero();
+    m_preDelayBufferR.zero();
     m_preDelayReadIndex = 0;
     m_preDelayWriteIndex = DefaultPreDelayFrames;
 
index da8e4c8..cf319b3 100644 (file)
 
 #include "AudioArray.h"
 
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
-
 namespace WebCore {
 
 class DynamicsCompressorKernel {
 public:
-    DynamicsCompressorKernel(float sampleRate, unsigned numberOfChannels);
-
-    void setNumberOfChannels(unsigned);
+    DynamicsCompressorKernel(float sampleRate);
 
     // Performs stereo-linked compression.
-    void process(float* sourceChannels[],
-                 float* destinationChannels[],
-                 unsigned numberOfChannels,
+    void process(const float *sourceL,
+                 float *destinationL,
+                 const float *sourceR,
+                 float *destinationR,
                  unsigned framesToProcess,
 
                  float dbThreshold,
@@ -70,7 +66,7 @@ public:
 
 protected:
     float m_sampleRate;
-
+    
     float m_detectorAverage;
     float m_compressorGain;
 
@@ -85,7 +81,8 @@ protected:
     unsigned m_lastPreDelayFrames;
     void setPreDelayTime(float);
 
-    Vector<OwnPtr<AudioFloatArray> > m_preDelayBuffers;
+    AudioFloatArray m_preDelayBufferL;
+    AudioFloatArray m_preDelayBufferR;
     int m_preDelayReadIndex;
     int m_preDelayWriteIndex;
 
index 2637555..ea8b589 100644 (file)
 #include "AudioNodeOutput.h"
 #include "DynamicsCompressor.h"
 
-// Set output to stereo by default.
-static const unsigned defaultNumberOfOutputChannels = 2;
-
 namespace WebCore {
 
 DynamicsCompressorNode::DynamicsCompressorNode(AudioContext* context, float sampleRate)
     : AudioNode(context, sampleRate)
 {
     addInput(adoptPtr(new AudioNodeInput(this)));
-    addOutput(adoptPtr(new AudioNodeOutput(this, defaultNumberOfOutputChannels)));
+    addOutput(adoptPtr(new AudioNodeOutput(this, 2)));
     
     setNodeType(NodeTypeDynamicsCompressor);
     
@@ -73,7 +70,7 @@ void DynamicsCompressorNode::initialize()
         return;
 
     AudioNode::initialize();    
-    m_dynamicsCompressor = adoptPtr(new DynamicsCompressor(sampleRate(), defaultNumberOfOutputChannels));
+    m_dynamicsCompressor = adoptPtr(new DynamicsCompressor(true, sampleRate()));
 }
 
 void DynamicsCompressorNode::uninitialize()