зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1266405 - AudioBufferSourceNode::CopyFromBuffer should not borrow unaligned buffers; r=padenot
MozReview-Commit-ID: 82DZJ8BFWaq --HG-- extra : rebase_source : 20d5a43df87cf826971bef149a1f29ee75c1c0d2
This commit is contained in:
Родитель
4c6dbce80d
Коммит
48b7390289
|
@ -10,6 +10,7 @@
|
|||
#include "mozilla/FloatingPoint.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "AlignmentUtils.h"
|
||||
#include "AudioNodeEngine.h"
|
||||
#include "AudioNodeStream.h"
|
||||
#include "AudioDestinationNode.h"
|
||||
|
@ -410,7 +411,15 @@ public:
|
|||
|
||||
uint32_t numFrames = std::min(aBufferMax - mBufferPosition,
|
||||
availableInOutput);
|
||||
if (numFrames == WEBAUDIO_BLOCK_SIZE) {
|
||||
|
||||
bool inputBufferAligned = true;
|
||||
for (uint32_t i = 0; i < aChannels; ++i) {
|
||||
if (!IS_ALIGNED16(mBuffer->GetData(i) + mBufferPosition)) {
|
||||
inputBufferAligned = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (numFrames == WEBAUDIO_BLOCK_SIZE && inputBufferAligned) {
|
||||
MOZ_ASSERT(mBufferPosition < aBufferMax);
|
||||
BorrowFromInputBuffer(aOutput, aChannels);
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче