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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // is updated to the new number of channels because of use of tryLocks() in | 112 // is updated to the new number of channels because of use of tryLocks() in |
113 // the context's updating system. In this case, if the the buffer has just | 113 // the context's updating system. In this case, if the the buffer has just |
114 // been changed and we're not quite ready yet, then just output silence. | 114 // been changed and we're not quite ready yet, then just output silence. |
115 if (numberOfChannels() != buffer()->numberOfChannels()) { | 115 if (numberOfChannels() != buffer()->numberOfChannels()) { |
116 outputBus->zero(); | 116 outputBus->zero(); |
117 return; | 117 return; |
118 } | 118 } |
119 | 119 |
120 size_t quantumFrameOffset; | 120 size_t quantumFrameOffset; |
121 size_t bufferFramesToProcess; | 121 size_t bufferFramesToProcess; |
122 double startTimeOffset; | |
123 | 122 |
124 updateSchedulingInfo(framesToProcess, outputBus, quantumFrameOffset, | 123 updateSchedulingInfo(framesToProcess, outputBus, quantumFrameOffset, |
125 bufferFramesToProcess, startTimeOffset); | 124 bufferFramesToProcess); |
126 | 125 |
127 if (!bufferFramesToProcess) { | 126 if (!bufferFramesToProcess) { |
128 outputBus->zero(); | 127 outputBus->zero(); |
129 return; | 128 return; |
130 } | 129 } |
131 | 130 |
132 for (unsigned i = 0; i < outputBus->numberOfChannels(); ++i) | 131 for (unsigned i = 0; i < outputBus->numberOfChannels(); ++i) |
133 m_destinationChannels[i] = outputBus->channel(i)->mutableData(); | 132 m_destinationChannels[i] = outputBus->channel(i)->mutableData(); |
134 | 133 |
135 // Render by reading directly from the buffer. | 134 // Render by reading directly from the buffer. |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 | 754 |
756 void AudioBufferSourceNode::start(double when, | 755 void AudioBufferSourceNode::start(double when, |
757 double grainOffset, | 756 double grainOffset, |
758 double grainDuration, | 757 double grainDuration, |
759 ExceptionState& exceptionState) { | 758 ExceptionState& exceptionState) { |
760 audioBufferSourceHandler().start(when, grainOffset, grainDuration, | 759 audioBufferSourceHandler().start(when, grainOffset, grainDuration, |
761 exceptionState); | 760 exceptionState); |
762 } | 761 } |
763 | 762 |
764 } // namespace blink | 763 } // namespace blink |
OLD | NEW |