mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 864083 - Cleanup AudioBuffer::GetThreadSharedChannelsForRate; r=padenot
This commit is contained in:
parent
285c08c9eb
commit
d7d8be9b4a
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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<ThreadSharedFloatArrayBufferList> 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() ?
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "AudioProcessingEvent.h"
|
||||
#include "WebAudioUtils.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "mozilla/PodOperations.h"
|
||||
#include <deque>
|
||||
|
||||
@ -304,10 +303,7 @@ private:
|
||||
// Steal the output buffers
|
||||
nsRefPtr<ThreadSharedFloatArrayBufferList> 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
|
||||
|
Loading…
Reference in New Issue
Block a user