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

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

Issue 59763002: Fix GetPairedOutputParameters (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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/webrtc_audio_capturer.cc
diff --git a/content/renderer/media/webrtc_audio_capturer.cc b/content/renderer/media/webrtc_audio_capturer.cc
index aa3ecf8627f84ca4165d481afd14b50388faf291..3362e1dae2fe882d69a433aae397b4db1da59762 100644
--- a/content/renderer/media/webrtc_audio_capturer.cc
+++ b/content/renderer/media/webrtc_audio_capturer.cc
@@ -453,11 +453,15 @@ bool WebRtcAudioCapturer::GetPairedOutputParameters(
int* session_id,
int* output_sample_rate,
int* output_frames_per_buffer) const {
+ // Don't set output parameters unless all of them are valid.
+ if (session_id_ <= 0 || !output_sample_rate_ || !output_frames_per_buffer_)
+ return false;
+
*session_id = session_id_;
*output_sample_rate = output_sample_rate_;
*output_frames_per_buffer = output_frames_per_buffer_;
- return session_id_ > 0 && output_sample_rate_ > 0 &&
- output_frames_per_buffer_> 0;
+
+ return true;
}
int WebRtcAudioCapturer::GetBufferSize(int sample_rate) const {
« 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