OLD | NEW |
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/audio_output_dispatcher_impl.h" | 5 #include "media/audio/audio_output_dispatcher_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 stream->Close(); | 161 stream->Close(); |
162 | 162 |
163 AudioStreamIDMap::iterator it = audio_stream_ids_.find(stream); | 163 AudioStreamIDMap::iterator it = audio_stream_ids_.find(stream); |
164 DCHECK(it != audio_stream_ids_.end()); | 164 DCHECK(it != audio_stream_ids_.end()); |
165 audio_log_->OnClosed(it->second); | 165 audio_log_->OnClosed(it->second); |
166 audio_stream_ids_.erase(it); | 166 audio_stream_ids_.erase(it); |
167 } | 167 } |
168 idle_streams_.erase(idle_streams_.begin() + keep_alive, idle_streams_.end()); | 168 idle_streams_.erase(idle_streams_.begin() + keep_alive, idle_streams_.end()); |
169 } | 169 } |
170 | 170 |
171 void AudioOutputDispatcherImpl::CloseStreamsForWedgeFix() { | |
172 DCHECK(task_runner_->BelongsToCurrentThread()); | |
173 CloseAllIdleStreams(); | |
174 } | |
175 | |
176 void AudioOutputDispatcherImpl::RestartStreamsForWedgeFix() { | |
177 DCHECK(task_runner_->BelongsToCurrentThread()); | |
178 | |
179 // Should only be called when the dispatcher is used with fake streams which | |
180 // don't need to be shutdown or restarted. | |
181 CHECK_EQ(params_.format(), AudioParameters::AUDIO_FAKE); | |
182 } | |
183 | |
184 } // namespace media | 171 } // namespace media |
OLD | NEW |