Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp

Issue 2223293002: Replace 4096 with rendering quantum size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698