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

Unified Diff: media/audio/mac/audio_input_mac.cc

Issue 8941001: Enable the AudioInputTest tests + Fix PCMQueueInAudioInputStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: address review comments Created 9 years 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 | « media/audio/mac/audio_input_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_input_mac.cc
===================================================================
--- media/audio/mac/audio_input_mac.cc (revision 114391)
+++ media/audio/mac/audio_input_mac.cc (working copy)
@@ -21,7 +21,8 @@
: manager_(manager),
callback_(NULL),
audio_queue_(NULL),
- buffer_size_bytes_(0) {
+ buffer_size_bytes_(0),
+ started_(false) {
// We must have a manager.
DCHECK(manager_);
// A frame is one sample across all channels. In interleaved audio the per
@@ -68,15 +69,18 @@
return;
callback_ = callback;
OSStatus err = AudioQueueStart(audio_queue_, NULL);
- if (err != noErr)
+ if (err != noErr) {
HandleError(err);
- else
+ } else {
+ started_ = true;
manager_->IncreaseActiveInputStreamCount();
+ }
}
void PCMQueueInAudioInputStream::Stop() {
- if (!audio_queue_)
+ if (!audio_queue_ || !started_)
return;
+
// Stop is always called before Close. In case of error, this will be
// also called when closing the input controller.
manager_->DecreaseActiveInputStreamCount();
@@ -86,6 +90,8 @@
OSStatus err = AudioQueueStop(audio_queue_, true);
if (err != noErr)
HandleError(err);
+
+ started_ = false;
}
void PCMQueueInAudioInputStream::Close() {
« no previous file with comments | « media/audio/mac/audio_input_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698