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

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

Issue 2860653003: Have AUAudioInputStream::Stop() also cancel any deferred start. (Closed)
Patch Set: Created 3 years, 7 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 | no next file » | 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 #include "media/audio/mac/audio_low_latency_input_mac.h" 4 #include "media/audio/mac/audio_low_latency_input_mac.h"
5 5
6 #include <CoreServices/CoreServices.h> 6 #include <CoreServices/CoreServices.h>
7 #include <mach/mach.h> 7 #include <mach/mach.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 // monitor if the input stream is alive or not. 570 // monitor if the input stream is alive or not.
571 check_alive_timer_.reset(new base::RepeatingTimer()); 571 check_alive_timer_.reset(new base::RepeatingTimer());
572 check_alive_timer_->Start( 572 check_alive_timer_->Start(
573 FROM_HERE, base::TimeDelta::FromSeconds(kCheckInputIsAliveTimeInSeconds), 573 FROM_HERE, base::TimeDelta::FromSeconds(kCheckInputIsAliveTimeInSeconds),
574 this, &AUAudioInputStream::CheckIfInputStreamIsAlive); 574 this, &AUAudioInputStream::CheckIfInputStreamIsAlive);
575 DCHECK(check_alive_timer_->IsRunning()); 575 DCHECK(check_alive_timer_->IsRunning());
576 } 576 }
577 577
578 void AUAudioInputStream::Stop() { 578 void AUAudioInputStream::Stop() {
579 DCHECK(thread_checker_.CalledOnValidThread()); 579 DCHECK(thread_checker_.CalledOnValidThread());
580 deferred_start_cb_.Cancel();
580 DVLOG(1) << "Stop"; 581 DVLOG(1) << "Stop";
581 StopAgc(); 582 StopAgc();
582 if (check_alive_timer_ != nullptr) { 583 if (check_alive_timer_ != nullptr) {
583 check_alive_timer_->Stop(); 584 check_alive_timer_->Stop();
584 check_alive_timer_.reset(); 585 check_alive_timer_.reset();
585 } 586 }
586 if (input_callback_timer_ != nullptr) { 587 if (input_callback_timer_ != nullptr) {
587 input_callback_timer_->Stop(); 588 input_callback_timer_->Stop();
588 input_callback_timer_.reset(); 589 input_callback_timer_.reset();
589 } 590 }
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 1668
1668 number_of_frames_provided_ = 0; 1669 number_of_frames_provided_ = 0;
1669 glitches_detected_ = 0; 1670 glitches_detected_ = 0;
1670 last_sample_time_ = 0; 1671 last_sample_time_ = 0;
1671 last_number_of_frames_ = 0; 1672 last_number_of_frames_ = 0;
1672 total_lost_frames_ = 0; 1673 total_lost_frames_ = 0;
1673 largest_glitch_frames_ = 0; 1674 largest_glitch_frames_ = 0;
1674 } 1675 }
1675 1676
1676 } // namespace media 1677 } // namespace media
OLDNEW
« 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