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

Unified Diff: components/copresence/mediums/audio/audio_recorder.cc

Issue 461803003: Stop playing/recording when not needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: components/copresence/mediums/audio/audio_recorder.cc
diff --git a/components/copresence/mediums/audio/audio_recorder.cc b/components/copresence/mediums/audio/audio_recorder.cc
index e19e3543dd1117113e7ad10535b86aeede38f0b0..7430b27d17c410f0e6effd072d17f293807703dc 100644
--- a/components/copresence/mediums/audio/audio_recorder.cc
+++ b/components/copresence/mediums/audio/audio_recorder.cc
@@ -51,8 +51,8 @@ void ProcessSamples(scoped_ptr<media::AudioBus> bus,
// Public methods.
AudioRecorder::AudioRecorder(const DecodeSamplesCallback& decode_callback)
- : stream_(NULL),
- is_recording_(false),
+ : is_recording_(false),
+ stream_(NULL),
decode_callback_(decode_callback),
total_buffer_frames_(0),
buffer_frame_index_(0) {
@@ -80,6 +80,10 @@ void AudioRecorder::Stop() {
base::Bind(&AudioRecorder::StopOnAudioThread, base::Unretained(this)));
}
+bool AudioRecorder::IsRecording() {
+ return is_recording_;
+}
+
void AudioRecorder::Finalize() {
media::AudioManager::Get()->GetTaskRunner()->PostTask(
FROM_HERE,
@@ -137,7 +141,6 @@ void AudioRecorder::RecordOnAudioThread() {
if (!stream_ || is_recording_)
return;
- DVLOG(2) << "Recording Audio.";
converter_->Reset();
stream_->Start(this);
is_recording_ = true;

Powered by Google App Engine
This is Rietveld 408576698