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

Side by Side Diff: media/audio/mac/audio_low_latency_input_mac.cc

Issue 621093002: Clear the FIFO when calling input stream::Stop() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed alsa Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/audio/pulse/pulse_input.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/audio/mac/audio_low_latency_input_mac.h" 5 #include "media/audio/mac/audio_low_latency_input_mac.h"
6 6
7 #include <CoreServices/CoreServices.h> 7 #include <CoreServices/CoreServices.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } 279 }
280 280
281 void AUAudioInputStream::Stop() { 281 void AUAudioInputStream::Stop() {
282 if (!started_) 282 if (!started_)
283 return; 283 return;
284 StopAgc(); 284 StopAgc();
285 OSStatus result = AudioOutputUnitStop(audio_unit_); 285 OSStatus result = AudioOutputUnitStop(audio_unit_);
286 DCHECK_EQ(result, noErr); 286 DCHECK_EQ(result, noErr);
287 started_ = false; 287 started_ = false;
288 sink_ = NULL; 288 sink_ = NULL;
289 fifo_.Clear();
289 290
290 OSSTATUS_DLOG_IF(ERROR, result != noErr, result) 291 OSSTATUS_DLOG_IF(ERROR, result != noErr, result)
291 << "Failed to stop acquiring data"; 292 << "Failed to stop acquiring data";
292 } 293 }
293 294
294 void AUAudioInputStream::Close() { 295 void AUAudioInputStream::Close() {
295 // It is valid to call Close() before calling open or Start(). 296 // It is valid to call Close() before calling open or Start().
296 // It is also valid to call Close() after Start() has been called. 297 // It is also valid to call Close() after Start() has been called.
297 if (started_) { 298 if (started_) {
298 Stop(); 299 Stop();
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 kAudioDevicePropertyScopeInput, 647 kAudioDevicePropertyScopeInput,
647 static_cast<UInt32>(channel) 648 static_cast<UInt32>(channel)
648 }; 649 };
649 OSStatus result = AudioObjectIsPropertySettable(input_device_id_, 650 OSStatus result = AudioObjectIsPropertySettable(input_device_id_,
650 &property_address, 651 &property_address,
651 &is_settable); 652 &is_settable);
652 return (result == noErr) ? is_settable : false; 653 return (result == noErr) ? is_settable : false;
653 } 654 }
654 655
655 } // namespace media 656 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/audio/pulse/pulse_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698