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

Unified Diff: media/audio/audio_output_dispatcher_impl.cc

Issue 61203008: Attempt to fix audio wedges by restarting all streams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
Index: media/audio/audio_output_dispatcher_impl.cc
diff --git a/media/audio/audio_output_dispatcher_impl.cc b/media/audio/audio_output_dispatcher_impl.cc
index eaac8a4daae98c4e0167fe57da5c5d147aecf78a..8ff39b2f72475a16521266dbf5859590b22faa5f 100644
--- a/media/audio/audio_output_dispatcher_impl.cc
+++ b/media/audio/audio_output_dispatcher_impl.cc
@@ -59,6 +59,8 @@ bool AudioOutputDispatcherImpl::StartStream(
AudioOutputStream::AudioSourceCallback* callback,
AudioOutputProxy* stream_proxy) {
DCHECK(message_loop_->BelongsToCurrentThread());
+ DCHECK(proxy_to_physical_map_.find(stream_proxy) ==
+ proxy_to_physical_map_.end());
if (idle_streams_.empty() && !CreateAndOpenStream())
return false;
@@ -186,4 +188,17 @@ void AudioOutputDispatcherImpl::ClosePendingStreams() {
}
}
+void AudioOutputDispatcherImpl::CloseStreamsForWedgeFix() {
+ DCHECK(message_loop_->BelongsToCurrentThread());
+ ClosePendingStreams();
scherkus (not reviewing) 2013/12/02 21:49:37 it seems this only closes idle_streams_ do we nee
DaleCurtis 2013/12/02 22:23:59 For 1) AODI doesn't track the AudioSourceCallback
+}
+
+void AudioOutputDispatcherImpl::RestartStreamsForWedgeFix() {
+ DCHECK(message_loop_->BelongsToCurrentThread());
+
+ // Should only be called when the dispatcher is used with fake streams which
+ // don't need to be shutdown or restarted.
+ CHECK_EQ(params_.format(), AudioParameters::AUDIO_FAKE);
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698