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..92c7da4a9594738d6c4a99151d11b9efd698ba6f 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,21 @@ void AudioOutputDispatcherImpl::ClosePendingStreams() { |
} |
} |
+void AudioOutputDispatcherImpl::CloseStreamsForWedgeFix() { |
+ DCHECK(message_loop_->BelongsToCurrentThread()); |
+ while (!pausing_streams_.empty()) { |
+ idle_streams_.push_back(pausing_streams_.back()); |
+ pausing_streams_.pop_back(); |
+ } |
+ ClosePendingStreams(); |
+} |
+ |
+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 |