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

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

Issue 2503693002: Tracks all open input streams in AudioManagerBase. (Closed)
Patch Set: fixes compile error on windows Created 4 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 | « media/audio/audio_manager_base.cc ('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_manager_mac.cc
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
index f59e9d4da4bfa90d9696b0a9b882a6d06a3952b1..14877a95f92eb8321907344a80187c9c9ae63a5f 100644
--- a/media/audio/mac/audio_manager_mac.cc
+++ b/media/audio/mac/audio_manager_mac.cc
@@ -384,34 +384,6 @@ AudioManagerMac::~AudioManagerMac() {
// and IncreaseIOBufferSizeIfPossible() which both touches native Core Audio
// APIs and they can fail and disrupt tests during shutdown.
in_shutdown_ = true;
- // We have seen cases where active input audio is not closed down properly
- // at browser shutdown. AudioInputController::Close() is called but tasks
- // in AudioInputController::DoClose() are not executed. Hence, input streams
- // might remain even at this late state. |low_latency_input_streams_| will be
- // modified during the call to stream->Close(), so we can't iterate over it
- // here. Instead iterate over a copy.
- // TODO(henrika): figure out the real cause why streams are not closed
- // properly by the AIC for all cases and then remove this loop.
- auto low_latency_input_streams_copy = low_latency_input_streams_;
- for (auto* stream : low_latency_input_streams_copy) {
- LOG(WARNING) << "Closing existing audio input stream at destruction";
- // Prevents active Core Audio callbacks to use possibly invalid objects
- // in its OnData() callback.
- stream->Stop();
- // Avoids hitting CHECK in dtor of AudioManagerBase.
- stream->Close();
- }
- // Perform same type of cleanup as above but for high-latency input streams.
- auto basic_input_streams_copy = basic_input_streams_;
- for (auto* stream : basic_input_streams_copy) {
- LOG(WARNING)
- << "Closing existing high-latency audio input stream at destruction";
- // Prevents active AudioQueue callbacks to use possibly invalid objects
- // in its OnData() callback.
- stream->Stop();
- // Avoids hitting CHECK in dtor of AudioManagerBase.
- stream->Close();
- }
Shutdown();
}
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698