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

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

Issue 2334773003: Support sample rates up to 384 kHz. (Closed)
Patch Set: Mark old histograms obsolete Created 4 years, 3 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 2d1e489aa55875d48d66576e229779f104f79649..13f577e2df2176cdf6b5f5e9eccc9f458a9b47ca 100644
--- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
@@ -253,7 +253,7 @@ AudioBuffer* BaseAudioContext::createBuffer(unsigned numberOfChannels, size_t nu
// AudioUtilities::maxAudioBufferSampleRate(). The number of buckets is
// fairly arbitrary.
DEFINE_STATIC_LOCAL(CustomCountHistogram, audioBufferSampleRateHistogram,
- ("WebAudio.AudioBuffer.SampleRate", 3000, 192000, 60));
+ ("WebAudio.AudioBuffer.SampleRate384k", 3000, 384000, 60));
audioBufferChannelsHistogram.sample(numberOfChannels);
audioBufferLengthHistogram.count(numberOfFrames);
@@ -265,12 +265,12 @@ AudioBuffer* BaseAudioContext::createBuffer(unsigned numberOfChannels, size_t nu
// 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.SampleRateRatio384K", 0, 12800, 50));
Mark P 2016/09/15 23:16:31 Min of histogram should always be "1". There will
Raymond Toy 2016/10/10 16:28:32 Done.
float ratio = 100 * sampleRate / this->sampleRate();
audioBufferSampleRateRatioHistogram.count(static_cast<int>(0.5 + ratio));
}

Powered by Google App Engine
This is Rietveld 408576698