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

Unified Diff: third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp

Issue 2334773003: Support sample rates up to 384 kHz. (Closed)
Patch Set: Rebase and fix up histograms.xml Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
index cb83b9a35728164a9ca67af4e53409db1ed868a5..900ff22c283d102ac3df0e3c25c321ab9442c380 100644
--- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
@@ -237,8 +237,9 @@ AudioBuffer* BaseAudioContext::createBuffer(unsigned numberOfChannels,
// AudioUtilities::minAudioBufferSampleRate() and
// AudioUtilities::maxAudioBufferSampleRate(). The number of buckets is
// fairly arbitrary.
- DEFINE_STATIC_LOCAL(CustomCountHistogram, audioBufferSampleRateHistogram,
- ("WebAudio.AudioBuffer.SampleRate", 3000, 192000, 60));
+ DEFINE_STATIC_LOCAL(
+ CustomCountHistogram, audioBufferSampleRateHistogram,
+ ("WebAudio.AudioBuffer.SampleRate384kHz", 3000, 384000, 60));
audioBufferChannelsHistogram.sample(numberOfChannels);
audioBufferLengthHistogram.count(numberOfFrames);
@@ -250,13 +251,13 @@ AudioBuffer* BaseAudioContext::createBuffer(unsigned numberOfChannels,
// integer. If the context is closed, don't record this because we
// don't have a sample rate for closed context.
if (!isContextClosed()) {
- // The limits are choosen from 100*(3000/192000) = 1.5625 and
- // 100*(192000/3000) = 6400, where 3000 and 192000 are the current
+ // The limits are choosen from 100*(3000/384000) = 0.78125 and
+ // 100*(384000/3000) = 12800, where 3000 and 384000 are the current
// min and max sample rates possible for an AudioBuffer. The number
// of buckets is fairly arbitrary.
DEFINE_STATIC_LOCAL(
CustomCountHistogram, audioBufferSampleRateRatioHistogram,
- ("WebAudio.AudioBuffer.SampleRateRatio", 1, 6400, 50));
+ ("WebAudio.AudioBuffer.SampleRateRatio384kHz", 1, 12800, 50));
float ratio = 100 * sampleRate / this->sampleRate();
audioBufferSampleRateRatioHistogram.count(static_cast<int>(0.5 + ratio));
}

Powered by Google App Engine
This is Rietveld 408576698