Bug 873553 - Part 8: Port DynamicsCompressorNode to use the stream's sampling rate; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 24 May 2013 13:10:59 -0400
changeset 132928 a10e7a43eebfe766586fa03e32525431f4b64738
parent 132927 4c425085391c20885227445376d5e94ac9c4a1cc
child 132929 0d624598cc17f7399d4151eb13be17a6354a7705
push id24727
push userphilringnalda@gmail.com
push dateSun, 26 May 2013 04:02:45 +0000
treeherdermozilla-central@0fed3377c839 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs873553
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 873553 - Part 8: Port DynamicsCompressorNode to use the stream's sampling rate; r=roc
content/media/webaudio/DynamicsCompressorNode.cpp
--- a/content/media/webaudio/DynamicsCompressorNode.cpp
+++ b/content/media/webaudio/DynamicsCompressorNode.cpp
@@ -41,17 +41,17 @@ public:
     , mDestination(static_cast<AudioNodeStream*> (aDestination->Stream()))
     // Keep the default value in sync with the default value in
     // DynamicsCompressorNode::DynamicsCompressorNode.
     , mThreshold(-24.f)
     , mKnee(30.f)
     , mRatio(12.f)
     , mAttack(0.003f)
     , mRelease(0.25f)
-    , mCompressor(new DynamicsCompressor(IdealAudioRate(), 2))
+    , mCompressor(new DynamicsCompressor(mDestination->SampleRate(), 2))
   {
   }
 
   void SetSourceStream(AudioNodeStream* aSource)
   {
     mSource = aSource;
   }
 
@@ -102,17 +102,17 @@ public:
       // Just output silence
       *aOutput = aInput;
       return;
     }
 
     const uint32_t channelCount = aInput.mChannelData.Length();
     if (mCompressor->numberOfChannels() != channelCount) {
       // Create a new compressor object with a new channel count
-      mCompressor = new WebCore::DynamicsCompressor(IdealAudioRate(),
+      mCompressor = new WebCore::DynamicsCompressor(aStream->SampleRate(),
                                                     aInput.mChannelData.Length());
     }
 
     TrackTicks pos = aStream->GetCurrentPosition();
     mCompressor->setParameterValue(DynamicsCompressor::ParamThreshold,
                                    mThreshold.GetValueAtTime(pos));
     mCompressor->setParameterValue(DynamicsCompressor::ParamKnee,
                                    mKnee.GetValueAtTime(pos));