diff --git a/content/media/webaudio/AudioBuffer.cpp b/content/media/webaudio/AudioBuffer.cpp index edc8f675c69..bc4377ab141 100644 --- a/content/media/webaudio/AudioBuffer.cpp +++ b/content/media/webaudio/AudioBuffer.cpp @@ -165,8 +165,7 @@ StealJSArrayDataIntoThreadSharedFloatArrayBufferList(JSContext* aJSContext, } ThreadSharedFloatArrayBufferList* -AudioBuffer::GetThreadSharedChannelsForRate(JSContext* aJSContext, uint32_t* aRate, - uint32_t* aLength) +AudioBuffer::GetThreadSharedChannelsForRate(JSContext* aJSContext) { if (!mSharedChannels) { // Steal JS data @@ -174,8 +173,6 @@ AudioBuffer::GetThreadSharedChannelsForRate(JSContext* aJSContext, uint32_t* aRa StealJSArrayDataIntoThreadSharedFloatArrayBufferList(aJSContext, mJSChannels); } - *aLength = mLength; - *aRate = mSampleRate; return mSharedChannels; } diff --git a/content/media/webaudio/AudioBuffer.h b/content/media/webaudio/AudioBuffer.h index 6d2056c9f56..f9ff7d2d25a 100644 --- a/content/media/webaudio/AudioBuffer.h +++ b/content/media/webaudio/AudioBuffer.h @@ -89,12 +89,9 @@ public: } /** - * Returns a ThreadSharedFloatArrayBufferList containing the sample data - * at aRate. Sets *aLength to the number of samples per channel. + * Returns a ThreadSharedFloatArrayBufferList containing the sample data. */ - ThreadSharedFloatArrayBufferList* GetThreadSharedChannelsForRate(JSContext* aContext, - uint32_t* aRate, - uint32_t* aLength); + ThreadSharedFloatArrayBufferList* GetThreadSharedChannelsForRate(JSContext* aContext); // aContents should either come from JS_AllocateArrayBufferContents or // JS_StealArrayBufferContents. diff --git a/content/media/webaudio/AudioBufferSourceNode.cpp b/content/media/webaudio/AudioBufferSourceNode.cpp index 334fe945593..9f8e04a6e96 100644 --- a/content/media/webaudio/AudioBufferSourceNode.cpp +++ b/content/media/webaudio/AudioBufferSourceNode.cpp @@ -457,10 +457,10 @@ AudioBufferSourceNode::Start(JSContext* aCx, double aWhen, double aOffset, return; } - uint32_t rate; - uint32_t lengthSamples; + float rate = mBuffer->SampleRate(); + int32_t lengthSamples = mBuffer->Length(); nsRefPtr data = - mBuffer->GetThreadSharedChannelsForRate(aCx, &rate, &lengthSamples); + mBuffer->GetThreadSharedChannelsForRate(aCx); double length = double(lengthSamples) / rate; double offset = std::max(0.0, aOffset); double endOffset = aDuration.WasPassed() ? diff --git a/content/media/webaudio/ScriptProcessorNode.cpp b/content/media/webaudio/ScriptProcessorNode.cpp index 0eff188de5c..61b3f6cf4eb 100644 --- a/content/media/webaudio/ScriptProcessorNode.cpp +++ b/content/media/webaudio/ScriptProcessorNode.cpp @@ -13,7 +13,6 @@ #include "AudioProcessingEvent.h" #include "WebAudioUtils.h" #include "mozilla/Mutex.h" -#include "mozilla/unused.h" #include "mozilla/PodOperations.h" #include @@ -304,10 +303,7 @@ private: // Steal the output buffers nsRefPtr output; if (event->HasOutputBuffer()) { - uint32_t rate, length; - output = event->OutputBuffer()->GetThreadSharedChannelsForRate(cx, &rate, &length); - unused << rate; - unused << length; + output = event->OutputBuffer()->GetThreadSharedChannelsForRate(cx); } // Append it to our output buffer queue