| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 unsigned busNumberOfChannels = bus->numberOfChannels(); | 166 unsigned busNumberOfChannels = bus->numberOfChannels(); |
| 167 | 167 |
| 168 bool channelCountGood = numberOfChannels && numberOfChannels == busNumberOfC
hannels; | 168 bool channelCountGood = numberOfChannels && numberOfChannels == busNumberOfC
hannels; |
| 169 ASSERT(channelCountGood); | 169 ASSERT(channelCountGood); |
| 170 if (!channelCountGood) | 170 if (!channelCountGood) |
| 171 return false; | 171 return false; |
| 172 | 172 |
| 173 // Sanity check destinationFrameOffset, numberOfFrames. | 173 // Sanity check destinationFrameOffset, numberOfFrames. |
| 174 size_t destinationLength = bus->length(); | 174 size_t destinationLength = bus->length(); |
| 175 | 175 |
| 176 bool isLengthGood = destinationLength <= 4096 && numberOfFrames <= 4096; | 176 bool isLengthGood = destinationLength <= AudioUtilities::kRenderQuantumFrame
s |
| 177 && numberOfFrames <= AudioUtilities::kRenderQuantumFrames; |
| 177 ASSERT(isLengthGood); | 178 ASSERT(isLengthGood); |
| 178 if (!isLengthGood) | 179 if (!isLengthGood) |
| 179 return false; | 180 return false; |
| 180 | 181 |
| 181 bool isOffsetGood = destinationFrameOffset <= destinationLength && destinati
onFrameOffset + numberOfFrames <= destinationLength; | 182 bool isOffsetGood = destinationFrameOffset <= destinationLength && destinati
onFrameOffset + numberOfFrames <= destinationLength; |
| 182 ASSERT(isOffsetGood); | 183 ASSERT(isOffsetGood); |
| 183 if (!isOffsetGood) | 184 if (!isOffsetGood) |
| 184 return false; | 185 return false; |
| 185 | 186 |
| 186 // Potentially zero out initial frames leading up to the offset. | 187 // Potentially zero out initial frames leading up to the offset. |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 { | 685 { |
| 685 audioBufferSourceHandler().start(when, grainOffset, exceptionState); | 686 audioBufferSourceHandler().start(when, grainOffset, exceptionState); |
| 686 } | 687 } |
| 687 | 688 |
| 688 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD
uration, ExceptionState& exceptionState) | 689 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD
uration, ExceptionState& exceptionState) |
| 689 { | 690 { |
| 690 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception
State); | 691 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception
State); |
| 691 } | 692 } |
| 692 | 693 |
| 693 } // namespace blink | 694 } // namespace blink |
| OLD | NEW |