Chromium Code Reviews| Index: Source/modules/webaudio/AudioBuffer.cpp |
| diff --git a/Source/modules/webaudio/AudioBuffer.cpp b/Source/modules/webaudio/AudioBuffer.cpp |
| index 54612e86bec61f079a18752d9fe652fee8b38a2a..a3462590825de07f0a8a177e07bdca7ac40b3f3a 100644 |
| --- a/Source/modules/webaudio/AudioBuffer.cpp |
| +++ b/Source/modules/webaudio/AudioBuffer.cpp |
| @@ -176,7 +176,9 @@ AudioBuffer::AudioBuffer(AudioBus* bus) |
| return; |
| channelDataArray->setNeuterable(false); |
| - channelDataArray->setRange(bus->channel(i)->data(), m_length, 0); |
| + const float* src = bus->channel(i)->data(); |
| + float* dst = channelDataArray->data(); |
| + memmove(dst, src, m_length * sizeof(*dst)); |
|
adamk
2015/06/12 17:59:25
For WebAudio reviewers: this memmove is from the o
Raymond Toy
2015/06/12 18:05:50
If the original did this, I'm happy with leaving i
adamk
2015/06/12 18:14:28
The destination of this memmove was just created w
|
| m_channels.append(channelDataArray); |
| } |
| } |
| @@ -317,8 +319,10 @@ void AudioBuffer::copyToChannel(DOMFloat32Array* source, long channelNumber, uns |
| void AudioBuffer::zero() |
| { |
| for (unsigned i = 0; i < m_channels.size(); ++i) { |
| - if (getChannelData(i)) |
| - getChannelData(i)->zeroRange(0, length()); |
| + if (DOMFloat32Array* array = getChannelData(i)) { |
| + float* data = array->data(); |
| + memset(data, 0, length() * sizeof(*data)); |
|
Raymond Toy
2015/06/12 18:05:50
The original had some checks on the parameters. Ar
adamk
2015/06/12 18:14:28
Same as above, all the channel data arrays have th
|
| + } |
| } |
| } |