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

Unified Diff: content/renderer/media/media_stream_audio_processor.cc

Issue 1377103002: Add sample rates checking in MediaStreamAudioProcessor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_audio_processor.cc
diff --git a/content/renderer/media/media_stream_audio_processor.cc b/content/renderer/media/media_stream_audio_processor.cc
index 23547d1b2b6490331f28d0110284f523044e1d57..b2a6215dc562f62cc78c8249cf531decc8c479fa 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -16,6 +16,7 @@
#include "media/base/audio_converter.h"
#include "media/base/audio_fifo.h"
#include "media/base/channel_layout.h"
+#include "media/base/limits.h"
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
#include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface.h"
#include "third_party/webrtc/modules/audio_processing/typing_detection.h"
@@ -137,7 +138,8 @@ class MediaStreamAudioFifo {
new MediaStreamAudioBus(destination_channels, destination_frames)),
data_available_(false) {
DCHECK_GE(source_channels, destination_channels);
- DCHECK_GT(sample_rate_, 0);
+ DCHECK_GE(sample_rate_, media::limits::kMinSampleRate);
Henrik Grunell 2015/09/30 08:19:25 I was thinking to test the set of explicit samples
henrika (OOO until Aug 14) 2015/09/30 08:49:18 Have not done the latest changes in this area and
+ DCHECK_LE(sample_rate_, media::limits::kMaxSampleRate);
if (source_channels > destination_channels) {
audio_source_intermediate_ =
« 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